diff options
author | Stan Hu <stanhu@gmail.com> | 2019-08-10 01:41:07 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-08-10 01:41:07 +0300 |
commit | afe867921cab046a34bc463840c6e9f5d51f1f70 (patch) | |
tree | dae8e191eb1ba98217f277cb1326297ee84df82b /spec | |
parent | d96c24d81590dd6da237f131d4c074b70e64e030 (diff) |
Rename branches_exist? -> includes_branches?
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/git_post_receive_spec.rb | 8 | ||||
-rw-r--r-- | spec/workers/post_receive_spec.rb | 11 |
2 files changed, 12 insertions, 7 deletions
diff --git a/spec/lib/gitlab/git_post_receive_spec.rb b/spec/lib/gitlab/git_post_receive_spec.rb index f4a10d8d984..1911e954df9 100644 --- a/spec/lib/gitlab/git_post_receive_spec.rb +++ b/spec/lib/gitlab/git_post_receive_spec.rb @@ -7,7 +7,7 @@ describe ::Gitlab::GitPostReceive do subject { described_class.new(project, "project-#{project.id}", changes.dup, {}) } - describe '#branches_exist?' do + describe '#includes_branches?' do context 'with no branches' do let(:changes) do <<~EOF @@ -18,7 +18,7 @@ describe ::Gitlab::GitPostReceive do end it 'returns false' do - expect(subject.branches_exist?).to be_falsey + expect(subject.includes_branches?).to be_falsey end end @@ -32,7 +32,7 @@ describe ::Gitlab::GitPostReceive do end it 'returns true' do - expect(subject.branches_exist?).to be_truthy + expect(subject.includes_branches?).to be_truthy end end @@ -45,7 +45,7 @@ describe ::Gitlab::GitPostReceive do end it 'returns false' do - expect(subject.branches_exist?).to be_falsey + expect(subject.includes_branches?).to be_falsey end end end diff --git a/spec/workers/post_receive_spec.rb b/spec/workers/post_receive_spec.rb index 01ccae194fb..081d95d4d79 100644 --- a/spec/workers/post_receive_spec.rb +++ b/spec/workers/post_receive_spec.rb @@ -61,16 +61,21 @@ describe PostReceive do end context "branches" do - let(:changes) { '123456 789012 refs/heads/tést' } + let(:changes) do + <<~EOF + '123456 789012 refs/heads/tést1' + '123456 789012 refs/heads/tést2' + EOF + end it 'expires the branches cache' do - expect(project.repository).to receive(:expire_branches_cache) + expect(project.repository).to receive(:expire_branches_cache).once described_class.new.perform(gl_repository, key_id, base64_changes) end it 'calls Git::BranchPushService' do - expect_next_instance_of(Git::BranchPushService) do |service| + expect_any_instance_of(Git::BranchPushService) do |service| expect(service).to receive(:execute).and_return(true) end |