Sha256: 5ae05f271249b19dcf476498b7204c58acb653a949f2426975f492ff642da87f

Contents?: true

Size: 650 Bytes

Versions: 2

Compression:

Stored size: 650 Bytes

Contents

require "test_helper"
require "integration_tests_helper"

class TokenTest < ActionDispatch::IntegrationTest
  def teardown
    Capybara.reset_sessions!
  end

  test "disabling OTP after successfully enabling" do
    # log in 1fa
    user = enable_otp_and_sign_in
    assert_equal user_otp_credential_path, current_path

    # otp 2fa
    fill_in "user_token", with: ROTP::TOTP.new(user.otp_auth_secret).at(Time.now)
    click_button "Submit Token"
    assert_equal root_path, current_path

    # disable OTP
    disable_otp

    # logout
    sign_out

    # log back in 1fa
    sign_user_in(user)

    assert_equal root_path, current_path
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
devise-otp-0.6.0 test/integration/token_test.rb
devise-otp-0.5.0 test/integration/token_test.rb