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

google_oauth2_config_examples.rb « google_cloud « projects « requests « shared_examples « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 63f6cffb3a0aeaddd20ca4b5a4700a51d5937ac8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

RSpec.shared_examples 'requires valid Google OAuth2 configuration' do
  context 'when GitLab instance does not have valid Google OAuth2 configuration ' do
    before do
      project.add_maintainer(user)
      unconfigured_google_oauth2 = Struct.new(:app_id, :app_secret)
                                         .new('', '')
      allow(Gitlab::Auth::OAuth::Provider).to receive(:config_for)
                                                .with('google_oauth2')
                                                .and_return(unconfigured_google_oauth2)
    end

    it 'renders forbidden' do
      sign_in(user)

      subject

      expect(response).to have_gitlab_http_status(:forbidden)
    end
  end
end