Sha256: dccd62435b8acca39911a8a34fe41ef4622a0baef8113609ea3fc58b43a3b0a5
Contents?: true
Size: 813 Bytes
Versions: 13
Compression:
Stored size: 813 Bytes
Contents
# frozen_string_literal: true module G5Authenticatable module Test # Helper methods for login/logout during request specs module RequestHelpers include Warden::Test::Helpers def login_user(user) login_as(user, scope: :user) end def logout_user logout :user end end end end RSpec.shared_context 'auth request' do include G5Authenticatable::Test::RequestHelpers let(:user) { FactoryBot.create(:g5_authenticatable_user) } before do login_user(user) stub_valid_access_token(user.g5_access_token) end after { logout_user } end RSpec.configure do |config| config.include G5Authenticatable::Test::RequestHelpers, type: :request config.after { Warden.test_reset! } config.include_context 'auth request', auth_request: true end
Version data entries
13 entries across 13 versions & 1 rubygems