Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/auth_helper_spec.rb')
-rw-r--r--spec/helpers/auth_helper_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/helpers/auth_helper_spec.rb b/spec/helpers/auth_helper_spec.rb
index b4cea7fb695..00c4a1880de 100644
--- a/spec/helpers/auth_helper_spec.rb
+++ b/spec/helpers/auth_helper_spec.rb
@@ -99,6 +99,22 @@ RSpec.describe AuthHelper do
end
end
+ describe 'experiment_enabled_button_based_providers' do
+ it 'returns the intersection set of github & google_oauth2 with enabled providers' do
+ allow(helper).to receive(:enabled_button_based_providers) { %w(twitter github google_oauth2) }
+
+ expect(helper.experiment_enabled_button_based_providers).to eq(%w(github google_oauth2))
+
+ allow(helper).to receive(:enabled_button_based_providers) { %w(google_oauth2 bitbucket) }
+
+ expect(helper.experiment_enabled_button_based_providers).to eq(%w(google_oauth2))
+
+ allow(helper).to receive(:enabled_button_based_providers) { %w(bitbucket) }
+
+ expect(helper.experiment_enabled_button_based_providers).to be_empty
+ end
+ end
+
describe 'button_based_providers_enabled?' do
before do
allow(helper).to receive(:auth_providers) { [:twitter, :github] }