RoR: wrong number of arguments

I try to call a method in my Rails 3 but I get:

Error / Error: integration_sign_in wrong_user ArgumentError: wrong number of arguments (0 for 1)

Here is the call code (in the RSpec helper):

before(:each) do wrong_user = Factory(:user, :email => " test@test.com ", :password=>"hellohello", :password_confirmation => "hellohello") integration_sign_in wrong_user end 

Thus, it explicitly passes one argument. If for some reason the argument is null, will it force it to be considered not a parameter?

RELATED RESERVATION: For testing, I simply switched from webrat to capybara. As suggested in Railscast 257 , I also installed launch planes and database_cleaner. When I used webrat, the code above worked as expected, but now (I think related to database_cleaner) something is going wrong.

Perhaps relevant: In my spec_helper.rb, I changed to: config.use_transactional_fixtures = false (although "true" has the same problem)

Any ideas? Thanks.

+4
source share
2 answers

It seems that the argument error was not actually in this function (although the top of the stack makes it look like it. Actual error inside the integr_sign_in function:

 def integration_sign_in(user) visit signin_path fill_in :email, :with => user.email fill_in :password, :with => user.password click_button end 

It looks like click_button needs an argument in capybara, but it is not in webrat.

+4
source
 integration_sign_in(wrong_user) 
0
source

All Articles