From 184c2ced0761bd8dd7032619d16d3983fed7944a Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 17 Oct 2019 18:08:05 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/support/matchers/graphql_matchers.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'spec/support/matchers') diff --git a/spec/support/matchers/graphql_matchers.rb b/spec/support/matchers/graphql_matchers.rb index 4d48b4b5389..d735c10f698 100644 --- a/spec/support/matchers/graphql_matchers.rb +++ b/spec/support/matchers/graphql_matchers.rb @@ -28,9 +28,15 @@ RSpec::Matchers.define :have_graphql_fields do |*expected| end end -RSpec::Matchers.define :have_graphql_field do |field_name| +RSpec::Matchers.define :have_graphql_field do |field_name, args = {}| match do |kls| - expect(kls.fields.keys).to include(GraphqlHelpers.fieldnamerize(field_name)) + field = kls.fields[GraphqlHelpers.fieldnamerize(field_name)] + + expect(field).to be_present + + args.each do |argument, value| + expect(field.send(argument)).to eq(value) + end end end -- cgit v1.2.1