-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
To replicate:
- use ree-1.8.7-2010.02 (via RVM with a gemset, but not sure if that affects result)
- use rails 3.0.0, rspec-rails 2.0.0.beta.22
- create a new rails project and cd into its directory
- $ rails g rspec:install
- $ rails g scaffold Project (where Project is arbitrary model name)
- create and migrate the database
- $ rails g scaffold Project # an arbitrary model name
- copy the spec for ProjectController's #create method to the specs for its #new method
- modify that spec example to call 'get :new' but otherwise leave it the same
it "saves the project" do Project.stub(:new).with({'these' => 'params'}) { mock_project(:save => true) } mock_project.should_receive(:save) get :new end
- in the Project controller's #new method add a line to call save on @project (this step is not necessary to reproduce the error)
- execute $ rake spec
- instead of a failure (on just the #new spec we added), it gives this error:
Failure/Error: @mock_project ||= mock_model(Project, stubs).as_null_object undefined method `mock' for # # /Users/myuser/.rvm/gems/ree-1.8.7-2010.02@mygemset/gems/actionpack-3.0.0/lib/action_dispatch/testing/assertions/routing.rb:177:in`method_missing' # /Users/myuser/.rvm/gems/ree-1.8.7-2010.02@mygemset/gems/rspec-rails-2.0.0.beta.22/lib/rspec/rails/mocks.rb:71:in `mock_model' # ./spec/controllers/projects_controller_spec.rb:6:in`mock_project' # ./spec/controllers/projects_controller_spec.rb:37
Metadata
Metadata
Assignees
Labels
No labels