summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/requests/api/graphql/projects/services_shared_examples.rb
blob: 246f1850c3cd72aea16ec2315693993c0d5364a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

shared_examples 'unauthorized users cannot read services' do
  before do
    post_graphql(query, current_user: current_user)
  end

  context 'when anonymous user' do
    let(:current_user) { nil }

    it { expect(services).to be nil }
  end

  context 'when user developer' do
    before do
      project.add_developer(current_user)
    end

    it { expect(services).to be nil }
  end
end