|
|
|
@ -30,10 +30,10 @@ RSpec.describe "Admin Panel" do
|
|
|
|
|
expect(page).to have_content("Two factor authentication successful.") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "but it is more than 5 minutes old" do |
|
|
|
|
context "but it is more than 15 minutes old" do |
|
|
|
|
it "does not authenticate successfully" do |
|
|
|
|
click_button("Login") |
|
|
|
|
admin.update!(direct_otp_sent_at: 10.minutes.ago) |
|
|
|
|
admin.update!(direct_otp_sent_at: 16.minutes.ago) |
|
|
|
|
fill_in("code", with: otp) |
|
|
|
|
click_button("Submit") |
|
|
|
|
expect(page).to have_content("Check your phone") |
|
|
|
|