Skip to content

Wrong number of arguments for respond_to? #282

Closed
@r38y

Description

@r38y

I am running into an error deep down in Rails when I use mock_model before trying to create an instance of a model. Here is the first part of the backtrace:

  1. WeighInNotifier.skipped_weigh_in_friend(friend, user, weigh_in) should have a reply-to of the user's email
    Failure/Error: @user = Factory(:user)
    wrong number of arguments (2 for 1)

    /Users/r38y/.rvm/gems/ree-1.8.7-2010.02@lioli/gems/activesupport-3.0.3/lib/active_support/time_with_zone.rb:311:in `respond_to?'

    /Users/r38y/.rvm/gems/ree-1.8.7-2010.02@lioli/gems/activesupport-3.0.3/lib/active_support/time_with_zone.rb:311:in`respond_to?'

I tracked it down to the following line:

https://github.com/rspec/rspec-rails/blob/master/lib/rspec/rails/mocks.rb#L103

I copied this code into my app and changed that to take two arguments and it almost works. The test hangs instead of failing.

I'm happy to fix this if it needs fixing, I just wanted some guidance about it. Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions