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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-03 12:07:16 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-03 12:07:16 +0300
commit2b67531b0fd7c94cb1d8618166c4193f40ea5a1f (patch)
treee6cefd08d250a04fde66e03de7c59f1e535463fd /spec/workers/post_receive_spec.rb
parented58c351374814027fbb2383ddecb9fa38de0c57 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/post_receive_spec.rb')
-rw-r--r--spec/workers/post_receive_spec.rb30
1 files changed, 29 insertions, 1 deletions
diff --git a/spec/workers/post_receive_spec.rb b/spec/workers/post_receive_spec.rb
index c8a0c22b0e8..fb89eae9fa9 100644
--- a/spec/workers/post_receive_spec.rb
+++ b/spec/workers/post_receive_spec.rb
@@ -43,6 +43,7 @@ describe PostReceive do
before do
allow_any_instance_of(Gitlab::GitPostReceive).to receive(:identify).and_return(empty_project.owner)
+ # Need to mock here so we can expect calls on project
allow(Gitlab::GlRepository).to receive(:parse).and_return([empty_project, Gitlab::GlRepository::PROJECT])
end
@@ -102,7 +103,7 @@ describe PostReceive do
end
it 'expires the status cache' do
- expect(project).to receive(:empty_repo?).and_return(true)
+ expect(project.repository).to receive(:empty?).and_return(true)
expect(project.repository).to receive(:expire_status_cache)
perform
@@ -300,6 +301,11 @@ describe PostReceive do
describe '#process_wiki_changes' do
let(:gl_repository) { "wiki-#{project.id}" }
+ before do
+ # Need to mock here so we can expect calls on project
+ allow(Gitlab::GlRepository).to receive(:parse).and_return([project, Gitlab::GlRepository::WIKI])
+ end
+
it 'updates project activity' do
# Force Project#set_timestamps_for_create to initialize timestamps
project
@@ -314,6 +320,28 @@ describe PostReceive do
.and change(project, :last_repository_updated_at)
end
end
+
+ context "branches" do
+ 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.wiki.repository).to receive(:expire_branches_cache).once
+
+ perform
+ end
+
+ it 'expires the status cache' do
+ expect(project.wiki.repository).to receive(:empty?).and_return(true)
+ expect(project.wiki.repository).to receive(:expire_status_cache)
+
+ perform
+ end
+ end
end
context "webhook" do