setup and rubocop corrections
This commit is contained in:
12
test/test_helpers/auth_test_helper.rb
Normal file
12
test/test_helpers/auth_test_helper.rb
Normal file
@ -0,0 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module AuthTestHelper
|
||||
def user_token user
|
||||
AuthenticateUser.new(email: user.email, password: 'password').perform
|
||||
end
|
||||
|
||||
def auth_headers user, headers = {}
|
||||
headers["HTTP_AUTHORIZATION"] = user_token(user)
|
||||
headers
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user