Keep controller specs off sessions

This commit is contained in:
Daniel Schädler 2026-04-29 08:32:19 +02:00
parent 2ababaa695
commit 6cce4f9cff
1 changed files with 4 additions and 1 deletions

View File

@ -4,6 +4,9 @@ module AuthHelpers
def apply_authentication_headers_for(user) def apply_authentication_headers_for(user)
user_headers = user.create_new_auth_token user_headers = user.create_new_auth_token
request.headers.merge!(user_headers) request.headers.merge!(user_headers)
sign_in(user, scope: :user) if respond_to?(:sign_in) return unless respond_to?(:controller)
allow(controller).to receive(:authenticate_user!).and_return(true)
allow(controller).to receive(:current_user).and_return(user)
end end
end end