Sha256: 80840a605153fda003160b8f4bd2a0322fd2d02764b9826563c68991a055d6ed

Contents?: true

Size: 653 Bytes

Versions: 2

Compression:

Stored size: 653 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_credential_path, current_path

    # otp two_factor
    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-2fa-0.1.1 test/integration/token_test.rb
devise-2fa-0.1.0 test/integration/token_test.rb