Skip to content

Commit

Permalink
Removed hardcoded numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-odowd committed Nov 1, 2022
1 parent e946533 commit 96376e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spec/controllers/password_retrieval_controller_spec.rb
Expand Up @@ -39,11 +39,12 @@

describe 'check if token is expired' do
it 'checks when token is expired' do
days_until_expiration = 2
non_encrypted_token = 'factory_bot_token'
@password_retrieval = FactoryBot.build(:password_reset, token: Digest::SHA1.hexdigest(non_encrypted_token))
@password_retrieval.save!
request_params = { token: non_encrypted_token }
Timecop.freeze(Time.zone.today + 2.days) do
Timecop.freeze(Time.zone.today + days_until_expiration.days) do
get :check_token_validity, params: request_params
expect(response).to render_template 'password_retrieval/forgotten'
end
Expand Down

0 comments on commit 96376e0

Please sign in to comment.