diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2018-02-09 17:46:41 +0100 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2018-02-09 17:46:41 +0100 |
commit | 922d156a5e0412a12662df94e03479f7ed015f7b (patch) | |
tree | b36694ea6070ec44bf95a1d02937cda291f87e22 /spec | |
parent | 2a970e02912a75962ce559ba49252a4696bbfbea (diff) | |
download | gitlab-ce-922d156a5e0412a12662df94e03479f7ed015f7b.tar.gz |
Separate branch and tag names
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/commits_spec.rb | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/spec/requests/api/commits_spec.rb b/spec/requests/api/commits_spec.rb index 964dd7ad39e..ac25f134697 100644 --- a/spec/requests/api/commits_spec.rb +++ b/spec/requests/api/commits_spec.rb @@ -492,35 +492,37 @@ describe API::Commits do it 'returns all refs with no scope' do get api(route, current_user) - repo_refs = project.repository.branch_names_contains(commit_id) - repo_refs.push(*project.repository.tag_names_contains(commit_id)) + branch_refs = project.repository.branch_names_contains(commit_id) + tag_refs = project.repository.tag_names_contains(commit_id) - expect(json_response.map { |refs| refs['name'] }).to eq(repo_refs) + expect(json_response.map { |refs| refs['branch_name'] }.compact).to eq(branch_refs) + expect(json_response.map { |refs| refs['tag_name'] }.compact).to eq(tag_refs) end it 'returns all refs' do get api(route, current_user), type: 'all' - repo_refs = project.repository.branch_names_contains(commit_id) - repo_refs.push(*project.repository.tag_names_contains(commit_id)) + branch_refs = project.repository.branch_names_contains(commit_id) + tag_refs = project.repository.tag_names_contains(commit_id) - expect(json_response.map { |refs| refs['name'] }).to eq(repo_refs) + expect(json_response.map { |refs| refs['branch_name'] }.compact).to eq(branch_refs) + expect(json_response.map { |refs| refs['tag_name'] }.compact).to eq(tag_refs) end it 'returns the branch refs' do get api(route, current_user), type: 'branches' - repo_refs = project.repository.branch_names_contains(commit_id) + branch_refs = project.repository.branch_names_contains(commit_id) - expect(json_response.map { |refs| refs['name'] }).to eq(repo_refs) + expect(json_response.map { |refs| refs['branch_name'] }.compact).to eq(branch_refs) end it 'returns the tag refs' do get api(route, current_user), type: 'tags' - repo_refs = project.repository.tag_names_contains(commit_id) + tag_refs = project.repository.tag_names_contains(commit_id) - expect(json_response.map { |refs| refs['name'] }).to eq(repo_refs) + expect(json_response.map { |refs| refs['tag_name'] }.compact).to eq(tag_refs) end end end |