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>2020-03-06 18:08:05 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-06 18:08:05 +0300
commitf78257cbddd711e18cbce93ad740a4aa0acac347 (patch)
tree7f018abe3ce1c0010879cc480f348a35e616fabb /spec/workers
parentf500600a43b531e2e7a5858b74bd35312b02c349 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/post_receive_spec.rb22
1 files changed, 20 insertions, 2 deletions
diff --git a/spec/workers/post_receive_spec.rb b/spec/workers/post_receive_spec.rb
index 72e423db611..2a2d0f5a857 100644
--- a/spec/workers/post_receive_spec.rb
+++ b/spec/workers/post_receive_spec.rb
@@ -421,17 +421,35 @@ describe PostReceive do
perform
end
end
+
+ it 'updates the snippet db information' do
+ blob = snippet.blobs.first
+
+ expect(snippet).to receive(:update).with(file_name: blob.path, content: blob.data)
+
+ perform
+ end
+
+ context 'when snippet does not have any blob' do
+ it 'does not update snippet db information' do
+ allow(snippet).to receive(:blobs).and_return([])
+
+ expect(snippet).not_to receive(:update)
+
+ perform
+ end
+ end
end
end
context 'with PersonalSnippet' do
- let!(:snippet) { create(:personal_snippet, author: project.owner) }
+ let!(:snippet) { create(:personal_snippet, :repository, author: project.owner) }
it_behaves_like 'snippet changes actions'
end
context 'with ProjectSnippet' do
- let!(:snippet) { create(:project_snippet, project: project, author: project.owner) }
+ let!(:snippet) { create(:project_snippet, :repository, project: project, author: project.owner) }
it_behaves_like 'snippet changes actions'
end