diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-06-14 15:06:53 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-06-15 14:38:32 +0200 |
commit | 9403b1d951c47aca67d2bac1369b86c125c5119d (patch) | |
tree | b87c3d85588b258dceb5c22ff1e855f3c7d48cdf /spec/support/matchers | |
parent | d85929d72aa3ffc2e96d12d7b6308d3bf541676c (diff) | |
download | gitlab-ce-9403b1d951c47aca67d2bac1369b86c125c5119d.tar.gz |
Allow querying a single MR within a project
This allows the user to get a single MR nested in a GraphQL project
query.
Since we need the full path and the iid anyway, this makes more sense
than having a root query that needs the full path as well.
Diffstat (limited to 'spec/support/matchers')
-rw-r--r-- | spec/support/matchers/graphql_matchers.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/support/matchers/graphql_matchers.rb b/spec/support/matchers/graphql_matchers.rb index ba7a1c8cde0..d23cbaf4beb 100644 --- a/spec/support/matchers/graphql_matchers.rb +++ b/spec/support/matchers/graphql_matchers.rb @@ -13,6 +13,12 @@ RSpec::Matchers.define :have_graphql_fields do |*expected| end end +RSpec::Matchers.define :have_graphql_field do |field_name| + match do |kls| + expect(kls.fields.keys).to include(GraphqlHelpers.fieldnamerize(field_name)) + end +end + RSpec::Matchers.define :have_graphql_arguments do |*expected| include GraphqlHelpers |