diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-03-08 18:04:00 +0100 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-03-08 18:19:40 +0100 |
commit | 590e1b4b21f2a39bf573800392b04859b563f3e5 (patch) | |
tree | 0f33085b2380828e760023c0dec5abb19130f977 /spec | |
parent | 4ec035b48869d8364f6ae8cb14c8486075786757 (diff) | |
download | gitlab-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.rb | 6 |
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 |