summaryrefslogtreecommitdiff
path: root/spec/requests/api/releases_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-14 21:06:30 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-14 21:06:30 +0000
commit565fa11a26c6824b1c6072d2dc5459979345ee57 (patch)
tree2668b631d925341e121c06b7b77cfe12954a015a /spec/requests/api/releases_spec.rb
parent8c30d396c5a789080345303330069981aa06e4af (diff)
downloadgitlab-ce-565fa11a26c6824b1c6072d2dc5459979345ee57.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api/releases_spec.rb')
-rw-r--r--spec/requests/api/releases_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/requests/api/releases_spec.rb b/spec/requests/api/releases_spec.rb
index 0bb238d08c0..99d0ceee76b 100644
--- a/spec/requests/api/releases_spec.rb
+++ b/spec/requests/api/releases_spec.rb
@@ -63,6 +63,22 @@ describe API::Releases do
expect(json_response.second['commit_path']).to eq("/#{release_1.project.full_path}/commit/#{release_1.commit.id}")
expect(json_response.second['tag_path']).to eq("/#{release_1.project.full_path}/-/tags/#{release_1.tag}")
end
+
+ it 'returns the merge requests and issues links, with correct query' do
+ get api("/projects/#{project.id}/releases", maintainer)
+
+ links = json_response.first['_links']
+ release = json_response.first['tag_name']
+ expected_query = "release_tag=#{release}&scope=all&state=opened"
+ path_base = "/#{project.namespace.path}/#{project.path}"
+ mr_uri = URI.parse(links['merge_requests_url'])
+ issue_uri = URI.parse(links['issues_url'])
+
+ expect(mr_uri.path).to eq("#{path_base}/merge_requests")
+ expect(issue_uri.path).to eq("#{path_base}/issues")
+ expect(mr_uri.query).to eq(expected_query)
+ expect(issue_uri.query).to eq(expected_query)
+ end
end
it 'returns an upcoming_release status for a future release' do