[rspec-users] RSpec 2: what should I replace 'params_from' with?

Ivo Wever lists at ruby-forum.com
Thu Jun 24 04:05:29 EDT 2010


I'm migrating an app to Rails 3 + RSpec 2 and, as expected, a number of
specs broke. Unfortunately, I can't really find how to fix them. For
instance, there is a spec:

describe SessionsController do
  describe "route recognition" do
    it "should generate params from GET /login correctly" do
      params_from(:get, '/login').should ==
        {:controller => 'sessions', :action => 'new'}

This spec is located in Rails.root +

The error is:

SessionsController route recognition should generate params from POST
/session correctly
    Failure/Error: params_from(:post, '/session').should == {:controller
=> 'sessions', :action => 'create'}
    undefined method `params_from' for
    # ./spec/controllers/sessions_controller_spec.rb:121

Also note the 'RSpec::Core::ExampleGroup': it seems like it doesn't
correctly infer it should be RSpec::Rails::ControllerExampleGroup?
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list