Trying to upgrade from Rails 4.1 to rails 4.2 and in the process devise from 3.0 to 3.4 (due to dependencies of 3.0)
I have a very basic controller:
class BasicController < ActionController::Base
#purposely not inherited from Application Controller to try and isolate the issue
before_filter :authenticate_user!
def index
end
end
routes.rb contains:
get 'basic/index'
And my spec for this controller is:
#purposely not included spec_helper as I don't want to complicate things.
1.describe BasicController do
2. it "should be able to get index" do
3. @request.env['devise.mapping'] = Devise.mappings[:user]
4. @current_user = FactoryGirl.create(:user)
5. sign_in :user, @current_user #Also tried sign_in @current_user
6. get :index
7. response.should be_success
8. end
9.end
This spec errors with ArgumentError: wrong number of arguments (2 for 1) #./spec/controllers/basic_controller_spec.rb:6
Using devise 3.4.1 and rails 4.2.0
If I replace factory girl with simple User.create(....) the error still occurs.
Any ideas why this could be happening?