diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-06-19 22:14:37 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-06-19 22:14:37 +0300 |
commit | b6318297fc93ab26108c586af9d34c16fc783589 (patch) | |
tree | 6755fcf5565a83fa7612081f902087601b69849c /spec/controllers | |
parent | 22dd2240a6ec80955b98667c727326135a2f7f53 (diff) |
Use User#two_factor_enabled instead of otp_required_for_login
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/profiles/two_factor_auths_controller_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/controllers/profiles/two_factor_auths_controller_spec.rb b/spec/controllers/profiles/two_factor_auths_controller_spec.rb index 65415f21e55..aa09f1a758d 100644 --- a/spec/controllers/profiles/two_factor_auths_controller_spec.rb +++ b/spec/controllers/profiles/two_factor_auths_controller_spec.rb @@ -40,11 +40,11 @@ describe Profiles::TwoFactorAuthsController do expect(user).to receive(:valid_otp?).with(pin).and_return(true) end - it 'sets otp_required_for_login' do + it 'sets two_factor_enabled' do go user.reload - expect(user.otp_required_for_login).to eq true + expect(user).to be_two_factor_enabled end it 'presents plaintext codes for the user to save' do @@ -109,13 +109,13 @@ describe Profiles::TwoFactorAuthsController do let!(:codes) { user.generate_otp_backup_codes! } it 'clears all 2FA-related fields' do - expect(user.otp_required_for_login).to eq true + expect(user).to be_two_factor_enabled expect(user.otp_backup_codes).not_to be_nil expect(user.encrypted_otp_secret).not_to be_nil delete :destroy - expect(user.otp_required_for_login).to eq false + expect(user).not_to be_two_factor_enabled expect(user.otp_backup_codes).to be_nil expect(user.encrypted_otp_secret).to be_nil end |