[rspec-users] webrat the way to go?

aslak hellesoy aslak.hellesoy at gmail.com
Mon Sep 29 02:48:56 EDT 2008

On Mon, Sep 29, 2008 at 8:46 AM, Willem van den Ende
<willem at willemvandenende.com> wrote:
> On Sun, 2008-09-28 at 22:24 +0200, Willem van den Ende wrote:
> <snip>
>> When I go to invitation/new, I see the Subject field, but WebRat doesn't... :
> <snip>
>>     When I fill in "Subject" with "My invitation subject"
>>       Could not find [Webrat::TextField, Webrat::TextareaField, Webrat::PasswordField]: "Subject" (RuntimeError)
> Ah. Figured it out. The cucumber code generator created (in
> manage_invitations.feature):
> When I fill in "Subject" with "My invitation subject"
> instead of
> When I fill in "invitation_subject" with "My invitation subject"
> which is what I saw in 'view source'. After changing all generated
> whens, I have 17 steps passed.

In the definition of "When I fill in..." you can add this debug
statement on the first line:

puts response.body

That should help you find the reason. Please post the HTML you see for
the failing step.
Also check log/test.log.


> It might indicate, as Aslak says in the readme, it is recommended to
> create your features by hand. On the other hand, it would also be
> convenient if the combination of generate feature and generate
> rspec_scaffold works out of the box. :)
> I'm going to play a bit more with it - too early to send in my own fix
> for the feature generator I guess. I am willing to make it if you want
> it though.
> Willem
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list