diff options
Diffstat (limited to 'spec/support/shared_examples/graphql')
-rw-r--r-- | spec/support/shared_examples/graphql/members_shared_examples.rb | 6 | ||||
-rw-r--r-- | spec/support/shared_examples/graphql/mutations/incident_management_timeline_events_shared_examples.rb | 1 | ||||
-rw-r--r-- | spec/support/shared_examples/graphql/mutations/security/ci_configuration_shared_examples.rb | 6 | ||||
-rw-r--r-- | spec/support/shared_examples/graphql/n_plus_one_query_examples.rb (renamed from spec/support/shared_examples/graphql/projects/merge_request_n_plus_one_query_examples.rb) | 0 | ||||
-rw-r--r-- | spec/support/shared_examples/graphql/resolvers/packages_resolvers_shared_examples.rb | 12 | ||||
-rw-r--r-- | spec/support/shared_examples/graphql/types/gitlab_style_deprecations_shared_examples.rb | 8 |
6 files changed, 19 insertions, 14 deletions
diff --git a/spec/support/shared_examples/graphql/members_shared_examples.rb b/spec/support/shared_examples/graphql/members_shared_examples.rb index 8e9e22f4359..110706c730b 100644 --- a/spec/support/shared_examples/graphql/members_shared_examples.rb +++ b/spec/support/shared_examples/graphql/members_shared_examples.rb @@ -39,7 +39,8 @@ RSpec.shared_examples 'querying members with a group' do let(:base_args) { { relations: described_class.arguments['relations'].default_value } } subject do - resolve(described_class, obj: resource, args: base_args.merge(args), ctx: { current_user: user_4 }) + resolve(described_class, obj: resource, args: base_args.merge(args), + ctx: { current_user: user_4 }, arg_style: :internal) end describe '#resolve' do @@ -73,7 +74,8 @@ RSpec.shared_examples 'querying members with a group' do let_it_be(:other_user) { create(:user) } subject do - resolve(described_class, obj: resource, args: base_args.merge(args), ctx: { current_user: other_user }) + resolve(described_class, obj: resource, args: base_args.merge(args), + ctx: { current_user: other_user }, arg_style: :internal) end it 'generates an error' do diff --git a/spec/support/shared_examples/graphql/mutations/incident_management_timeline_events_shared_examples.rb b/spec/support/shared_examples/graphql/mutations/incident_management_timeline_events_shared_examples.rb index b989dbc6524..cd591248ff6 100644 --- a/spec/support/shared_examples/graphql/mutations/incident_management_timeline_events_shared_examples.rb +++ b/spec/support/shared_examples/graphql/mutations/incident_management_timeline_events_shared_examples.rb @@ -21,6 +21,7 @@ RSpec.shared_examples 'creating an incident timeline event' do expect(timeline_event.occurred_at.to_s).to eq(expected_timeline_event.occurred_at) expect(timeline_event.incident).to eq(expected_timeline_event.incident) expect(timeline_event.author).to eq(expected_timeline_event.author) + expect(timeline_event.editable).to eq(expected_timeline_event.editable) end end diff --git a/spec/support/shared_examples/graphql/mutations/security/ci_configuration_shared_examples.rb b/spec/support/shared_examples/graphql/mutations/security/ci_configuration_shared_examples.rb index 21260e4d954..dfb8ce64391 100644 --- a/spec/support/shared_examples/graphql/mutations/security/ci_configuration_shared_examples.rb +++ b/spec/support/shared_examples/graphql/mutations/security/ci_configuration_shared_examples.rb @@ -71,7 +71,7 @@ RSpec.shared_examples_for 'graphql mutations security ci configuration' do end it 'returns an array of errors' do - expect(result).to match( + expect(result).to include( branch: be_nil, success_path: be_nil, errors: match_array([error_message]) @@ -92,7 +92,7 @@ RSpec.shared_examples_for 'graphql mutations security ci configuration' do end it 'returns a success path' do - expect(result).to match( + expect(result).to include( branch: branch, success_path: success_path, errors: [] @@ -108,7 +108,7 @@ RSpec.shared_examples_for 'graphql mutations security ci configuration' do end it 'returns an array of errors' do - expect(result).to match( + expect(result).to include( branch: be_nil, success_path: be_nil, errors: match_array([error]) diff --git a/spec/support/shared_examples/graphql/projects/merge_request_n_plus_one_query_examples.rb b/spec/support/shared_examples/graphql/n_plus_one_query_examples.rb index 738edd43c92..738edd43c92 100644 --- a/spec/support/shared_examples/graphql/projects/merge_request_n_plus_one_query_examples.rb +++ b/spec/support/shared_examples/graphql/n_plus_one_query_examples.rb diff --git a/spec/support/shared_examples/graphql/resolvers/packages_resolvers_shared_examples.rb b/spec/support/shared_examples/graphql/resolvers/packages_resolvers_shared_examples.rb index da8562161e7..3017f62a7c9 100644 --- a/spec/support/shared_examples/graphql/resolvers/packages_resolvers_shared_examples.rb +++ b/spec/support/shared_examples/graphql/resolvers/packages_resolvers_shared_examples.rb @@ -24,7 +24,7 @@ RSpec.shared_examples 'group and projects packages resolver' do create(:maven_package, name: 'baz', project: project, created_at: 1.minute.ago, version: nil) end - [:created_desc, :name_desc, :version_desc, :type_asc].each do |order| + %w[CREATED_DESC NAME_DESC VERSION_DESC TYPE_ASC].each do |order| context "#{order}" do let(:args) { { sort: order } } @@ -32,7 +32,7 @@ RSpec.shared_examples 'group and projects packages resolver' do end end - [:created_asc, :name_asc, :version_asc, :type_desc].each do |order| + %w[CREATED_ASC NAME_ASC VERSION_ASC TYPE_DESC].each do |order| context "#{order}" do let(:args) { { sort: order } } @@ -41,25 +41,25 @@ RSpec.shared_examples 'group and projects packages resolver' do end context 'filter by package_name' do - let(:args) { { package_name: 'bar', sort: :created_desc } } + let(:args) { { package_name: 'bar', sort: 'CREATED_DESC' } } it { is_expected.to eq([conan_package]) } end context 'filter by package_type' do - let(:args) { { package_type: 'conan', sort: :created_desc } } + let(:args) { { package_type: 'conan', sort: 'CREATED_DESC' } } it { is_expected.to eq([conan_package]) } end context 'filter by status' do - let(:args) { { status: 'error', sort: :created_desc } } + let(:args) { { status: 'error', sort: 'CREATED_DESC' } } it { is_expected.to eq([maven_package]) } end context 'include_versionless' do - let(:args) { { include_versionless: true, sort: :created_desc } } + let(:args) { { include_versionless: true, sort: 'CREATED_DESC' } } it { is_expected.to include(repository3) } 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 cf9c36fafe8..7fd54408b11 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 @@ -53,18 +53,20 @@ RSpec.shared_examples 'Gitlab-style deprecations' do it 'adds information about the replacement if provided' do deprecable = subject(deprecated: { milestone: '1.10', reason: :renamed, replacement: 'Foo.bar' }) - expect(deprecable.deprecation_reason).to include 'Please use `Foo.bar`' + expect(deprecable.deprecation_reason).to include('Please use `Foo.bar`') end it 'supports named reasons: renamed' do deprecable = subject(deprecated: { milestone: '1.10', reason: :renamed }) - expect(deprecable.deprecation_reason).to include 'This was renamed.' + expect(deprecable.deprecation_reason).to eq('This was renamed. Deprecated in 1.10.') end it 'supports named reasons: alpha' do deprecable = subject(deprecated: { milestone: '1.10', reason: :alpha }) - expect(deprecable.deprecation_reason).to include 'This feature is in Alpha' + expect(deprecable.deprecation_reason).to eq( + 'This feature is in Alpha. It can be changed or removed at any time. Introduced in 1.10.' + ) end end |