summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-18 13:16:46 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-18 13:16:46 +0000
commit798f2fe19f4fb90a99d77f3d77011cdba5a73046 (patch)
tree5e855c4b52322ed250a7f658f4e2e0379dbb5194 /spec
parent2a704396fb434c56a1ca2c41d65fd22a8b9a6d9c (diff)
parent6e808fc222dde420749fcf9ed006cfb6983e4b70 (diff)
downloadgitlab-ce-798f2fe19f4fb90a99d77f3d77011cdba5a73046.tar.gz
Merge branch 'mr-source-branch-clear-cache' into 'master'
Clear cache to prevent listing deleted branches after MR removes source branch Closes #2272 See merge request !1160
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/satellite/merge_action_spec.rb14
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