Do I need a custom Devise controller if only changing the Sign Up view?

I have the following steps in a capybara/rspec integration test, that is simply trying to sign up a new member.

 visit new_member_registration_path
 fill_in('Name:',                     :with => 'Rob Doe' )
 fill_in('member_email',              :with => 'rob@smith.com' )
 fill_in('member_email_confirmation', :with => 'rob@smith.com' )
 fill_in('member_password',           :with => 'secret')
 fill_in('Company or Venue Name:',    :with => 'Rob Inc.')
 fill_in('Contact Number:',           :with => '040544404440')
 click_button('Sign up')
 save_and_open_page

For some reason the 'email' and 'password' data is not being passed to the DeviseRegistrations controller (it is blank when viewing the test log) and therefore causing the validation to fail. However up until the save_and_open_page there is no rspec errors (so those fields are being filled in).

What am I missing? Do I need to subclass the DeviseRegistrations controller?

Tested on Rails 3.0.7 with rack-test 0.5.7 and rails 3.1rc1 and rack-test 0.6.0

7
задан robzolkos 22 May 2011 в 03:21
поделиться