Input validation

Commit by commit review
Linked to https://www.agileplannerapp.com/boards/105200/cards/6340
Agreed. I think this can be done fairly easily, but it's not urgent right
now, and certainly not a blocker for SPL.

On 30 October 2014 17:16, Camille Baldock <notifications@github.com> wrote:

> In spec/acceptance/flow_spec.rb:
>
> > +    context "flow state" do
> > +      context "with no answers given" do
> > +        specify { expect(flow.state("y",[]).current_answers).to be_empty }
> > +        specify { expect(flow.state("y",[]).accepted_responses).to eq [] }
> > +      end
> > +
> > +      context "with a valid answer given to the first question" do
> > +        specify { expect(flow.state("y",["cat"]).current_node.title).to eq "You picked a safe pet" }
> > +        specify { expect(flow.state("y",["cat"]).accepted_responses).to eq ["cat"] }
> > +        specify { expect(flow.state("y",["cat"]).current_answers).to eq [] }
> > +      end
> > +
> > +      context "with an invalid answer given to the first question" do
> > +        specify { expect(flow.state("y",["lynx"]).current_node.title).to eq "Amazing page title" }
> > +        specify { expect(flow.state("y",["lynx"]).accepted_responses).to eq [] }
> > +        specify { expect(flow.state("y",["lynx"]).current_answers.first.error).to eq "Invalid choice" }
>
> Created a follow up card for the error message discussion:
> https://www.agileplannerapp.com/boards/105200/cards/8042 => @dsingleton
> <https://github.com/dsingleton> let's check it out when you're back in,
> added to bottom of backlog as I judge it a non-blocker for go-live on SPL
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/alphagov/smartdown/pull/80/files#r19620027>.
>



-- 
*David Singleton*

Cabinet Office, Government Digital Service
Technical Lead, User Formats Team
david.singleton@digital.cabinet-office.gov.uk