summaryrefslogtreecommitdiff
path: root/spec/graphql
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2019-01-31 03:00:30 +0800
committerLin Jen-Shin <godfat@godfat.org>2019-02-14 15:52:17 +0800
commit91e9e50a1153021257abaa528498d7a82cc3350f (patch)
tree654dd11658da179f0bd4bd0eea5e4d63718c99b1 /spec/graphql
parent1322146bbf5c76403db10969f1af6540717b1cdf (diff)
downloadgitlab-ce-91e9e50a1153021257abaa528498d7a82cc3350f.tar.gz
Add field mergeRequests for project in GraphQL
And fix the tests so that it won't run into circular paths.
Diffstat (limited to 'spec/graphql')
-rw-r--r--spec/graphql/resolvers/merge_requests_resolver_spec.rb (renamed from spec/graphql/resolvers/merge_request_resolver_spec.rb)10
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/graphql/resolvers/merge_request_resolver_spec.rb b/spec/graphql/resolvers/merge_requests_resolver_spec.rb
index 73993b3a039..782a530e6f7 100644
--- a/spec/graphql/resolvers/merge_request_resolver_spec.rb
+++ b/spec/graphql/resolvers/merge_requests_resolver_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe Resolvers::MergeRequestResolver do
+describe Resolvers::MergeRequestsResolver do
include GraphqlHelpers
set(:project) { create(:project, :repository) }
@@ -18,7 +18,7 @@ describe Resolvers::MergeRequestResolver do
describe '#resolve' do
it 'batch-resolves merge requests by target project full path and IID' do
result = batch(max_queries: 2) do
- [resolve_mr(project, iid_1), resolve_mr(project, iid_2)]
+ resolve_mr(project, iid_1) + resolve_mr(project, iid_2)
end
expect(result).to contain_exactly(merge_request_1, merge_request_2)
@@ -26,7 +26,9 @@ describe Resolvers::MergeRequestResolver do
it 'can batch-resolve merge requests from different projects' do
result = batch(max_queries: 3) do
- [resolve_mr(project, iid_1), resolve_mr(project, iid_2), resolve_mr(other_project, other_iid)]
+ resolve_mr(project, iid_1) +
+ resolve_mr(project, iid_2) +
+ resolve_mr(other_project, other_iid)
end
expect(result).to contain_exactly(merge_request_1, merge_request_2, other_merge_request)
@@ -35,7 +37,7 @@ describe Resolvers::MergeRequestResolver do
it 'resolves an unknown iid to nil' do
result = batch { resolve_mr(project, -1) }
- expect(result).to be_nil
+ expect(result).to be_empty
end
end