micro-blogger/test/test_helpers/auth_test_helper.rb

13 lines
269 B
Ruby
Raw Normal View History

2018-11-10 10:40:22 -06:00
# 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