diff options
author | Stan Hu <stanhu@gmail.com> | 2015-08-13 18:23:48 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-08-14 07:09:25 -0700 |
commit | 6e808fc222dde420749fcf9ed006cfb6983e4b70 (patch) | |
tree | 8cb7d8bd2b18853d34ac002d815b3e6d6f1e32ea /spec | |
parent | f6f58cfb1fd7bc7fcef5e9b1f2ce658a15047b1d (diff) | |
download | gitlab-ce-6e808fc222dde420749fcf9ed006cfb6983e4b70.tar.gz |
Clear cache to prevent listing deleted branches after MR removes source branch
Closes #2272
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/satellite/merge_action_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/gitlab/satellite/merge_action_spec.rb b/spec/lib/gitlab/satellite/merge_action_spec.rb index 9b1c9a34e29..e977261c726 100644 --- a/spec/lib/gitlab/satellite/merge_action_spec.rb +++ b/spec/lib/gitlab/satellite/merge_action_spec.rb @@ -101,4 +101,18 @@ describe 'Gitlab::Satellite::MergeAction' do end end end + + describe '#merge!' do + let(:merge_request) { create(:merge_request, source_project: project, target_project: project, source_branch: "markdown", should_remove_source_branch: true) } + let(:merge_action) { Gitlab::Satellite::MergeAction.new(merge_request.author, merge_request) } + + it 'clears cache of source repo after removing source branch' do + project.repository.expire_branch_names + expect(project.repository.branch_names).to include('markdown') + + merge_action.merge! + + expect(project.repository.branch_names).not_to include('markdown') + end + end end |