summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-03-01 15:43:19 +0100
committerRobert Speicher <rspeicher@gmail.com>2016-03-11 15:25:21 -0500
commit508b6b46fea6b4bae9ce19c0337bafdb694edda8 (patch)
tree38cf1882f185c23205325a4660e8abebe1aebf89 /spec
parent1f5284e5ddf2ce9b555799f43ca73be32d9bdf67 (diff)
downloadgitlab-ce-508b6b46fea6b4bae9ce19c0337bafdb694edda8.tar.gz
Use ILIKE/LIKE for searching notes
Diffstat (limited to 'spec')
-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