diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/services/merge_requests/pushed_branches_service_spec.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/services/merge_requests/pushed_branches_service_spec.rb')
-rw-r--r-- | spec/services/merge_requests/pushed_branches_service_spec.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/spec/services/merge_requests/pushed_branches_service_spec.rb b/spec/services/merge_requests/pushed_branches_service_spec.rb index 6e9c77bd3b6..cd6af4c275e 100644 --- a/spec/services/merge_requests/pushed_branches_service_spec.rb +++ b/spec/services/merge_requests/pushed_branches_service_spec.rb @@ -8,19 +8,24 @@ RSpec.describe MergeRequests::PushedBranchesService do context 'when branches pushed' do let(:pushed_branches) do - %w(branch1 branch2 extra1 extra2 extra3).map do |branch| + %w(branch1 branch2 closed-branch1 closed-branch2 extra1 extra2).map do |branch| { ref: "refs/heads/#{branch}" } end end - it 'returns only branches which have a merge request' do + it 'returns only branches which have a open and closed merge request' do create(:merge_request, source_branch: 'branch1', source_project: project) create(:merge_request, source_branch: 'branch2', source_project: project) create(:merge_request, target_branch: 'branch2', source_project: project) - create(:merge_request, :closed, target_branch: 'extra1', source_project: project) - create(:merge_request, source_branch: 'extra2') - - expect(service.execute).to contain_exactly('branch1', 'branch2') + create(:merge_request, :closed, target_branch: 'closed-branch1', source_project: project) + create(:merge_request, :closed, source_branch: 'closed-branch2', source_project: project) + create(:merge_request, source_branch: 'extra1') + + expect(service.execute).to contain_exactly( + 'branch1', + 'branch2', + 'closed-branch2' + ) end end |