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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-12 03:09:18 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-12 03:09:18 +0300
commit723dc8aced90172b7f6e20ad5484083c4c821fa7 (patch)
treef99d3f3fd161e554e3424179257022dd880771f8 /spec/support/matchers
parent19d63dbca44d8380b8bc0d51d890137691ddf2a7 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/matchers')
-rw-r--r--spec/support/matchers/graphql_matchers.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/support/matchers/graphql_matchers.rb b/spec/support/matchers/graphql_matchers.rb
index 8c4ba387a74..565c21e0f85 100644
--- a/spec/support/matchers/graphql_matchers.rb
+++ b/spec/support/matchers/graphql_matchers.rb
@@ -1,5 +1,7 @@
# frozen_string_literal: true
+RSpec::Matchers.define_negated_matcher :be_nullable, :be_non_null
+
RSpec::Matchers.define :require_graphql_authorizations do |*expected|
match do |klass|
permissions = if klass.respond_to?(:required_permissions)
@@ -90,7 +92,7 @@ RSpec::Matchers.define :have_graphql_arguments do |*expected|
@names ||= Array.wrap(expected).map { |name| GraphqlHelpers.fieldnamerize(name) }
if field.type.try(:ancestors)&.include?(GraphQL::Types::Relay::BaseConnection)
- @names | %w(after before first last)
+ @names | %w[after before first last]
else
@names
end
@@ -103,9 +105,10 @@ RSpec::Matchers.define :have_graphql_arguments do |*expected|
end
failure_message do |field|
- names = expected_names(field)
+ names = expected_names(field).inspect
+ args = field.arguments.keys.inspect
- "expected that #{field.name} would have the following fields: #{names.inspect}, but it has #{field.arguments.keys.inspect}."
+ "expected that #{field.name} would have the following arguments: #{names}, but it has #{args}."
end
end