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:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-06-14 16:06:53 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2018-06-15 15:38:32 +0300
commit9403b1d951c47aca67d2bac1369b86c125c5119d (patch)
treeb87c3d85588b258dceb5c22ff1e855f3c7d48cdf /spec/support/matchers
parentd85929d72aa3ffc2e96d12d7b6308d3bf541676c (diff)
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.rb6
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