diff options
Diffstat (limited to 'spec/lib/gitlab/auth')
-rw-r--r-- | spec/lib/gitlab/auth/auth_finders_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/auth/o_auth/user_spec.rb | 44 |
2 files changed, 1 insertions, 45 deletions
diff --git a/spec/lib/gitlab/auth/auth_finders_spec.rb b/spec/lib/gitlab/auth/auth_finders_spec.rb index d0b44135a2f..e2226952d15 100644 --- a/spec/lib/gitlab/auth/auth_finders_spec.rb +++ b/spec/lib/gitlab/auth/auth_finders_spec.rb @@ -188,7 +188,7 @@ RSpec.describe Gitlab::Auth::AuthFinders do end it 'returns nil if valid feed_token and disabled' do - stub_application_setting(disable_feed_token: true) + allow(Gitlab::CurrentSettings).to receive_messages(disable_feed_token: true) set_param(:feed_token, user.feed_token) expect(find_user_from_feed_token(:rss)).to be_nil diff --git a/spec/lib/gitlab/auth/o_auth/user_spec.rb b/spec/lib/gitlab/auth/o_auth/user_spec.rb index b160f322fb8..95a518afcf1 100644 --- a/spec/lib/gitlab/auth/o_auth/user_spec.rb +++ b/spec/lib/gitlab/auth/o_auth/user_spec.rb @@ -4,7 +4,6 @@ require 'spec_helper' RSpec.describe Gitlab::Auth::OAuth::User do include LdapHelpers - include TermsHelper let(:oauth_user) { described_class.new(auth_hash) } let(:oauth_user_2) { described_class.new(auth_hash_2) } @@ -145,49 +144,6 @@ RSpec.describe Gitlab::Auth::OAuth::User do expect(gl_user).to be_password_automatically_set end - context 'terms of service' do - context 'when terms are enforced' do - before do - enforce_terms - end - - context 'when feature flag update_oauth_registration_flow is enabled' do - before do - stub_feature_flags(update_oauth_registration_flow: true) - end - - it 'creates the user with accepted terms' do - oauth_user.save # rubocop:disable Rails/SaveBang - - expect(gl_user).to be_persisted - expect(gl_user.terms_accepted?).to be(true) - end - end - - context 'when feature flag update_oauth_registration_flow is disabled' do - before do - stub_feature_flags(update_oauth_registration_flow: false) - end - - it 'creates the user without accepted terms' do - oauth_user.save # rubocop:disable Rails/SaveBang - - expect(gl_user).to be_persisted - expect(gl_user.terms_accepted?).to be(false) - end - end - end - - context 'when terms are not enforced' do - it 'creates the user without accepted terms' do - oauth_user.save # rubocop:disable Rails/SaveBang - - expect(gl_user).to be_persisted - expect(gl_user.terms_accepted?).to be(false) - end - end - end - shared_examples 'to verify compliance with allow_single_sign_on' do context 'provider is marked as external' do it 'marks user as external' do |