summaryrefslogtreecommitdiff
path: root/spec/features/oauth_login_spec.rb
diff options
context:
space:
mode:
authordodocat <jingqq5210@gmail.com>2019-08-27 03:46:32 +0000
committerMichael Kozono <mkozono@gmail.com>2019-08-27 03:46:32 +0000
commit6e2032f24e0428189f8c9fe9e296a9630277155e (patch)
tree79ed8e273c4ee80512a11ca1029cd20426625457 /spec/features/oauth_login_spec.rb
parent5e59c919d780441a5605d76e76ce63a69166464d (diff)
downloadgitlab-ce-6e2032f24e0428189f8c9fe9e296a9630277155e.tar.gz
Update docs and comments about saml with allow_bypass_two_factor
allow_bypass_two_factor configration dose not work with saml provider
Diffstat (limited to 'spec/features/oauth_login_spec.rb')
-rw-r--r--spec/features/oauth_login_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/features/oauth_login_spec.rb b/spec/features/oauth_login_spec.rb
index a47eaa9bda7..c6e69fa3fb0 100644
--- a/spec/features/oauth_login_spec.rb
+++ b/spec/features/oauth_login_spec.rb
@@ -55,6 +55,18 @@ describe 'OAuth Login', :js, :allow_forgery_protection do
expect(current_path).to eq root_path
end
+
+ it 'when bypass-two-factor is enabled' do
+ allow(Gitlab.config.omniauth).to receive_messages(allow_bypass_two_factor: true)
+ login_via(provider.to_s, user, uid, remember_me: false)
+ expect(current_path).to eq root_path
+ end
+
+ it 'when bypass-two-factor is disabled' do
+ allow(Gitlab.config.omniauth).to receive_messages(allow_bypass_two_factor: false)
+ login_with_provider(provider, enter_two_factor: true)
+ expect(current_path).to eq root_path
+ end
end
context 'when "remember me" is checked' do