scinote-web/spec/support/controller_macros.rb

11 lines
219 B
Ruby
Raw Normal View History

module ControllerMacros
def login_user
before(:each) do
2017-08-29 19:11:42 +08:00
@request.env['devise.mapping'] = Devise.mappings[:user]
user = FactoryGirl.create(:user)
user.confirm
sign_in user
end
end
end