summaryrefslogtreecommitdiff
path: root/spec/models/snippet_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-11 18:09:23 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-11 18:09:23 +0000
commit76e9fc7b29c1ce716c26932e9fbec0f3c99f53f4 (patch)
treeb5ca8e3a6b2cf93b67257b38ee71e2efee177700 /spec/models/snippet_spec.rb
parenta210c43e0aca0311cc1d3d381763b25979ec72dc (diff)
downloadgitlab-ce-76e9fc7b29c1ce716c26932e9fbec0f3c99f53f4.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/snippet_spec.rb')
-rw-r--r--spec/models/snippet_spec.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/models/snippet_spec.rb b/spec/models/snippet_spec.rb
index 95807f5f0c1..c9656b4d6ca 100644
--- a/spec/models/snippet_spec.rb
+++ b/spec/models/snippet_spec.rb
@@ -149,7 +149,7 @@ describe Snippet do
end
describe '.search' do
- let(:snippet) { create(:snippet, title: 'test snippet') }
+ let(:snippet) { create(:snippet, title: 'test snippet', description: 'description') }
it 'returns snippets with a matching title' do
expect(described_class.search(snippet.title)).to eq([snippet])
@@ -174,6 +174,10 @@ describe Snippet do
it 'returns snippets with a matching file name regardless of the casing' do
expect(described_class.search(snippet.file_name.upcase)).to eq([snippet])
end
+
+ it 'returns snippets with a matching description' do
+ expect(described_class.search(snippet.description)).to eq([snippet])
+ end
end
describe '.search_code' do