diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-05 18:17:47 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-05 18:17:47 +0000 |
commit | bc4cd6ffb93ae695f20ea54f4e4803d50c78a69e (patch) | |
tree | 2364d0f880af998b70356628f79cda64f13a11e7 /spec/models/user_spec.rb | |
parent | 6634288474d2a83cac7b4205f3ffc736cc6b36db (diff) | |
download | gitlab-ce-bc4cd6ffb93ae695f20ea54f4e4803d50c78a69e.tar.gz |
Add latest changes from gitlab-org/gitlab@master
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) } |