summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-03-08 18:04:00 +0100
committerYorick Peterse <yorickpeterse@gmail.com>2016-03-08 18:19:40 +0100
commit590e1b4b21f2a39bf573800392b04859b563f3e5 (patch)
tree0f33085b2380828e760023c0dec5abb19130f977 /spec
parent4ec035b48869d8364f6ae8cb14c8486075786757 (diff)
downloadgitlab-ce-590e1b4b21f2a39bf573800392b04859b563f3e5.tar.gz
Call after_create_branch in Repository#add_branchbranch-tag-count-methods
This ensures the right caches are flushed when adding a branch via the UI, instead of only flushing this one random cache.
Diffstat (limited to 'spec')
-rw-r--r--spec/models/repository_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index 97778c354a4..34866be3395 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -148,6 +148,12 @@ describe Repository, models: true do
expect(branch.name).to eq('new_feature')
end
+
+ it 'calls the after_create_branch hook' do
+ expect(repository).to receive(:after_create_branch)
+
+ repository.add_branch(user, 'new_feature', 'master')
+ end
end
context 'when pre hooks failed' do