diff options
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r-- | spec/models/user_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 60583bc351d..f1d3b17fd6f 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -2174,6 +2174,20 @@ RSpec.describe User, feature_category: :user_profile do end end + describe '#sign_in_with_codes_allowed?' do + let_it_be(:user) { create(:user, :two_factor_via_webauthn) } + + context 'when `webauthn_without_totp` disabled' do + before do + stub_feature_flags(webauthn_without_totp: false) + end + + it { expect(user.sign_in_with_codes_allowed?).to eq(false) } + end + + it { expect(user.sign_in_with_codes_allowed?).to eq(true) } + end + describe '#two_factor_otp_enabled?' do let_it_be(:user) { create(:user) } |