diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 10:00:54 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 10:00:54 +0000 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/support/shared_examples/graphql | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) | |
download | gitlab-ce-3cccd102ba543e02725d247893729e5c73b38295.tar.gz |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/support/shared_examples/graphql')
3 files changed, 14 insertions, 13 deletions
diff --git a/spec/support/shared_examples/graphql/mutations/boards_create_shared_examples.rb b/spec/support/shared_examples/graphql/mutations/boards_create_shared_examples.rb index 2e3a3ce6b41..04bb2fb69bb 100644 --- a/spec/support/shared_examples/graphql/mutations/boards_create_shared_examples.rb +++ b/spec/support/shared_examples/graphql/mutations/boards_create_shared_examples.rb @@ -3,16 +3,6 @@ RSpec.shared_examples 'boards create mutation' do include GraphqlHelpers - let_it_be(:current_user, reload: true) { create(:user) } - let(:name) { 'board name' } - let(:mutation) { graphql_mutation(:create_board, params) } - - subject { post_graphql_mutation(mutation, current_user: current_user) } - - def mutation_response - graphql_mutation_response(:create_board) - end - context 'when the user does not have permission' do it_behaves_like 'a mutation that returns a top-level access error' diff --git a/spec/support/shared_examples/graphql/notes_creation_shared_examples.rb b/spec/support/shared_examples/graphql/notes_creation_shared_examples.rb index 56b6dc682eb..2c6118779e6 100644 --- a/spec/support/shared_examples/graphql/notes_creation_shared_examples.rb +++ b/spec/support/shared_examples/graphql/notes_creation_shared_examples.rb @@ -85,3 +85,14 @@ RSpec.shared_examples 'a Note mutation when there are rate limit validation erro end end end + +RSpec.shared_examples 'a Note mutation with confidential notes' do + it_behaves_like 'a Note mutation that creates a Note' + + it 'returns a Note with confidentiality enabled' do + post_graphql_mutation(mutation, current_user: current_user) + + expect(mutation_response).to have_key('note') + expect(mutation_response['note']['confidential']).to eq(true) + end +end diff --git a/spec/support/shared_examples/graphql/types/gitlab_style_deprecations_shared_examples.rb b/spec/support/shared_examples/graphql/types/gitlab_style_deprecations_shared_examples.rb index efb2c466f70..3caf153c2fa 100644 --- a/spec/support/shared_examples/graphql/types/gitlab_style_deprecations_shared_examples.rb +++ b/spec/support/shared_examples/graphql/types/gitlab_style_deprecations_shared_examples.rb @@ -62,9 +62,9 @@ RSpec.shared_examples 'Gitlab-style deprecations' do expect(deprecable.deprecation_reason).to include 'This was renamed.' end - it 'supports named reasons: discouraged' do - deprecable = subject(deprecated: { milestone: '1.10', reason: :discouraged }) + it 'supports named reasons: alpha' do + deprecable = subject(deprecated: { milestone: '1.10', reason: :alpha }) - expect(deprecable.deprecation_reason).to include 'Use of this is not recommended.' + expect(deprecable.deprecation_reason).to include 'This feature is in Alpha' end end |