diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-17 18:08:05 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-17 18:08:05 +0000 |
commit | 184c2ced0761bd8dd7032619d16d3983fed7944a (patch) | |
tree | cc82b32ee7c1797509da3cf384617e4ffa2e1733 /spec/support/matchers | |
parent | 238d22c07218adf2b8f3db630ee8b74ca6f29df5 (diff) | |
download | gitlab-ce-184c2ced0761bd8dd7032619d16d3983fed7944a.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/matchers')
-rw-r--r-- | spec/support/matchers/graphql_matchers.rb | 10 |
1 files changed, 8 insertions, 2 deletions
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 |