Browse Source

Return 422 if OTP auth is unsuccessful

pull/270/head
baarkerlounger 3 years ago
parent
commit
cf2ac1c964
  1. 4
      Gemfile.lock
  2. 2
      spec/features/admin_panel_spec.rb

4
Gemfile.lock

@ -20,7 +20,7 @@ GIT
GIT GIT
remote: https://github.com/baarkerlounger/two_factor_authentication.git remote: https://github.com/baarkerlounger/two_factor_authentication.git
revision: a7522becd7222f1aa4ddf73d7caf19f05bdb4dac revision: 025d0a39ae971798402a7cefbd677cb15aa4983c
specs: specs:
two_factor_authentication (2.2.0) two_factor_authentication (2.2.0)
devise devise
@ -117,7 +117,7 @@ GEM
ast (2.4.2) ast (2.4.2)
aws-eventstream (1.2.0) aws-eventstream (1.2.0)
aws-partitions (1.551.0) aws-partitions (1.551.0)
aws-sdk-core (3.125.5) aws-sdk-core (3.125.6)
aws-eventstream (~> 1, >= 1.0.2) aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0) aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.1)

2
spec/features/admin_panel_spec.rb

@ -37,6 +37,7 @@ RSpec.describe "Admin Panel" do
fill_in("code", with: otp) fill_in("code", with: otp)
click_button("Submit") click_button("Submit")
expect(page).to have_content("Check your phone") expect(page).to have_content("Check your phone")
expect(page).to have_http_status(:unprocessable_entity)
end end
end end
end end
@ -50,6 +51,7 @@ RSpec.describe "Admin Panel" do
fill_in("code", with: otp) fill_in("code", with: otp)
click_button("Submit") click_button("Submit")
expect(page).to have_content("Check your phone") expect(page).to have_content("Check your phone")
expect(page).to have_http_status(:unprocessable_entity)
end end
end end

Loading…
Cancel
Save