From b4358772e1dafbdfd65145534cf54e1b3911ce96 Mon Sep 17 00:00:00 2001 From: Dominik Kwiatek Date: Sun, 15 Nov 2020 21:27:38 +0100 Subject: [PATCH] Fix test for expired OTP --- spec/controllers/user_controller_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index a5b92a44..d3789066 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -129,9 +129,10 @@ describe UserController, type: :controller do end it "shows an error if the user attempts to use the code once it has expired" do - Timecop.freeze(Time.at(1603290910)) do + Timecop.freeze(Time.at(1603290950)) do subject - expect(flash[:error]).to eq('The code you entered was invalid.') + expect(response).to redirect_to :edit_user_security + expect(flash[:error]).to eq(I18n.t('views.auth.2fa.errors.invalid_code')) end end end