Open adonespitogo opened 7 years ago
I'm trying to create a helper for test authentication. But I get the error below. Debugger shows Knock only has Engine constant and no AuthToken
Engine
AuthToken
[1, 10] in /home/adones/Projects/Rails/unsakini/spec/support/auth_helper.rb 1: 2: module AuthHelper 3: 4: def auth_headers(user) 5: debugger => 6: token = Knock::AuthToken.new(payload: { sub: user.id }).token 7: 8: { 9: 'Authorization': "Bearer #{token}" 10: } (byebug) Knock.constants [:Engine] (byebug)
(byebug) Knock::AuthToken *** NameError Exception: uninitialized constant Knock::AuthToken nil (byebug)
You probably need to configure it in rails_helper.rb:
rails_helper.rb
require 'support/auth_helper' # ... config.include AuthHelper
I'm trying to create a helper for test authentication. But I get the error below. Debugger shows Knock only has
Engine
constant and noAuthToken