summaryrefslogtreecommitdiff
path: root/spec/support/matchers/graphql_matchers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/matchers/graphql_matchers.rb')
-rw-r--r--spec/support/matchers/graphql_matchers.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/support/matchers/graphql_matchers.rb b/spec/support/matchers/graphql_matchers.rb
index be6fa4c71a0..7be84838e00 100644
--- a/spec/support/matchers/graphql_matchers.rb
+++ b/spec/support/matchers/graphql_matchers.rb
@@ -34,6 +34,15 @@ RSpec::Matchers.define :have_graphql_field do |field_name|
end
end
+RSpec::Matchers.define :have_graphql_mutation do |mutation_class|
+ match do |mutation_type|
+ field = mutation_type.fields[GraphqlHelpers.fieldnamerize(mutation_class.graphql_name)]
+
+ expect(field).to be_present
+ expect(field.resolver).to eq(mutation_class)
+ end
+end
+
RSpec::Matchers.define :have_graphql_arguments do |*expected|
include GraphqlHelpers