[rspec-users] Specifying a few valid values

David Chelimsky dchelimsky at gmail.com
Thu Jul 17 19:22:27 EDT 2008

On Thu, Jul 17, 2008 at 11:04 AM, Jonathan Leighton
<j at jonathanleighton.com> wrote:
> On Thu, 2008-07-17 at 09:40 -0500, David Chelimsky wrote:
>> On Thu, Jul 17, 2008 at 9:37 AM, Zach Dennis <zach.dennis at gmail.com> wrote:
>> > Perhaps...
>> >
>> >  When "I login with invalid credentials"
>> >  Then "I see that I have not been logged in"
>> Or ....
>> When I login with invalid credentials
>> Then I should see the login form
>> And I should see a message saying "Something went wrong."
> What would be the implementation of "Then I should see the login form"?
> We are already testing for an error message :)

As with all things, context is everything.

*If* I were going to have such a step, I'd do it based on things in the form:

Then "should see the login form" do
  response.should have_tag('input#login')
  response.should have_tag('input#password')

That's more granular than I generally like, but that's what probably
what I'd do in this scenario.


> Jon
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list