added new AuthenticationToken factory, as well as new tests to check if access is denied when the token is expired, smaller optimalization changes to the user_mailer_spec and authentication_spec
This commit is contained in:

committed by
Sebastian Serth

parent
146eee673f
commit
1a987a65d4
13
spec/factories/authentication_token.rb
Normal file
13
spec/factories/authentication_token.rb
Normal file
@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
FactoryBot.define do
|
||||
factory :authentication_token, class: 'AuthenticationToken' do
|
||||
created_by_external_user
|
||||
shared_secret { SecureRandom.hex(32) }
|
||||
expire_at { 7.days.from_now }
|
||||
|
||||
trait :invalid do
|
||||
expire_at { 8.days.ago }
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user