[rspec-users] Oddness with fieldnames containing an underscore
apremdas at gmail.com
Wed Dec 10 19:57:21 EST 2008
Probably not a bug, if you look at the id's of the fields your matching by
viewing source in your browser you'll see that they have an id that begins
with 'user'. So when webrat fails to match on the label text it then tries
to match on the id. You can use the debugger to step into the webrat code
and see this yourself if you want
2008/12/10 John Meredith <johnm at psynix.com>
> Hi all,
> I'm not sure if this is a cucumber or webrat thing given that I only
> starting tinkering with both last night for the first time (testing newb as
> well), but I've come across an oddity when trying to write a scenario to
> create a user.
> Scenario: Register new user
> Given I am on the new user page
> And I fill in "login" with "fredf"
> And I fill in "password" with "somepassword"
> And I fill in "password_confirmation" with "somepassword"
> And I select "Mr" from "title"
> And I fill in "given_names" with "Fred"
> And I fill in "surname" with "Flintstone"
> And I fill in "email" with "fredf at rocks.com"
> And I press "Create"
> Then there should be 1 more user
> When I 'rake features' it halts at the password_confirmation line...
> Scenario: Register new user #
> Given I am on the new user page #
> And I fill in "login" with "johnm" #
> And I fill in "password" with "Lmmsoht" #
> And I fill in "password_confirmation" with "Lmmsoht" #
> Could not find field: "password_confirmation" (Webrat::NotFoundError)
> The test passes if I prepend "user_" to the field name ie.
> "user_password_confirmation". Same applies to the 'given_names' field.
> Is this a bug or am I making an incorrect assumption on how things are
> supposed to work?
> "I'm not dumb. I just have a command of thoroughly useless information"
> - Calvin & Hobbes
> rspec-users mailing list
> rspec-users at rubyforge.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users