-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
I'm using CanCan for authorisation and it relies on params[:action] and params[:controller] to determine what resource to load for authorisation checks in a before filter. The specs work when CanCan is disabled so the routing etc is all correct.
The spec is:
describe "GET 'new'" do
it "should be successful" do
get 'new'
response.should be_success
end
end
I can see that the params hash is empty within the action method which is wrong as it should have the action and controller entries. I can work around this by modifying the spec for now, i.e.:
describe "GET 'new'" do
it "should be successful" do
get 'new', { :action => :new, :controller => :users }
response.should be_success
end
end
I suspect this is due to the usage of ActionDispatch::Integration as you mention on similar issues (http://rspec.lighthouseapp.com/projects/5645/tickets/963-request-is-nil and http://github.com/rspec/rspec-rails/issues#issue/10).