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:
authorYorick Peterse <yorickpeterse@gmail.com>2016-03-01 17:43:19 +0300
committerRobert Speicher <rspeicher@gmail.com>2016-03-11 23:25:21 +0300
commit508b6b46fea6b4bae9ce19c0337bafdb694edda8 (patch)
tree38cf1882f185c23205325a4660e8abebe1aebf89 /spec/models
parent1f5284e5ddf2ce9b555799f43ca73be32d9bdf67 (diff)
Use ILIKE/LIKE for searching notes
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/note_spec.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb
index 33085dac4ea..cd620ea5440 100644
--- a/spec/models/note_spec.rb
+++ b/spec/models/note_spec.rb
@@ -140,10 +140,16 @@ describe Note, models: true do
end
end
- describe :search do
- let!(:note) { create(:note, note: "WoW") }
+ describe '.search' do
+ let(:note) { create(:note, note: 'WoW') }
- it { expect(Note.search('wow')).to include(note) }
+ it 'returns notes with matching content' do
+ expect(described_class.search(note.note)).to eq([note])
+ end
+
+ it 'returns notes with matching content regardless of the casing' do
+ expect(described_class.search('WOW')).to eq([note])
+ end
end
describe :grouped_awards do