Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-08-14 04:23:48 +0300
committerStan Hu <stanhu@gmail.com>2015-08-14 17:09:25 +0300
commit6e808fc222dde420749fcf9ed006cfb6983e4b70 (patch)
tree8cb7d8bd2b18853d34ac002d815b3e6d6f1e32ea /spec
parentf6f58cfb1fd7bc7fcef5e9b1f2ce658a15047b1d (diff)
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.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