Fixes #voodoorai2000 comments
Fixes some comments from #voodoorai2000 for the PR to consul
This commit is contained in:
22
spec/shared/request_spec_helper.rb
Normal file
22
spec/shared/request_spec_helper.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
module RequestSpecHelper
|
||||
include Warden::Test::Helpers
|
||||
|
||||
def self.included(base)
|
||||
base.before(:each) { Warden.test_mode! }
|
||||
base.after(:each) { Warden.test_reset! }
|
||||
end
|
||||
|
||||
def sign_in(resource)
|
||||
login_as(resource, scope: warden_scope(resource))
|
||||
end
|
||||
|
||||
def sign_out(resource)
|
||||
logout(warden_scope(resource))
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def warden_scope(resource)
|
||||
resource.class.name.underscore.to_sym
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user