diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-11-24 14:08:16 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-11-24 19:28:50 +0300 |
commit | b2c5363da1bdfb4df8693de38f9d83fe203e6e99 (patch) | |
tree | 9aea4618ab6081d51e977091a6d456d635496129 /spec/lib/gitlab/sql | |
parent | aedd2cfa5b82c01f82ec26b64880fce2a07fe942 (diff) |
Rename to_fuzzy_arel to fuzzy_arel_match
Diffstat (limited to 'spec/lib/gitlab/sql')
-rw-r--r-- | spec/lib/gitlab/sql/pattern_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/lib/gitlab/sql/pattern_spec.rb b/spec/lib/gitlab/sql/pattern_spec.rb index 48d56628ed5..d2989489e49 100644 --- a/spec/lib/gitlab/sql/pattern_spec.rb +++ b/spec/lib/gitlab/sql/pattern_spec.rb @@ -137,14 +137,14 @@ describe Gitlab::SQL::Pattern do end end - describe '.to_fuzzy_arel' do - subject(:to_fuzzy_arel) { Issue.to_fuzzy_arel(:title, query) } + describe '.fuzzy_arel_match' do + subject(:fuzzy_arel_match) { Issue.fuzzy_arel_match(:title, query) } context 'with a word equal to 3 chars' do let(:query) { 'foo' } it 'returns a single ILIKE condition' do - expect(to_fuzzy_arel.to_sql).to match(/title.*I?LIKE '\%foo\%'/) + expect(fuzzy_arel_match.to_sql).to match(/title.*I?LIKE '\%foo\%'/) end end @@ -152,7 +152,7 @@ describe Gitlab::SQL::Pattern do let(:query) { 'fo' } it 'returns nil' do - expect(to_fuzzy_arel).to be_nil + expect(fuzzy_arel_match).to be_nil end end @@ -160,7 +160,7 @@ describe Gitlab::SQL::Pattern do let(:query) { 'foo baz' } it 'returns a joining LIKE condition using a AND' do - expect(to_fuzzy_arel.to_sql).to match(/title.+I?LIKE '\%foo\%' AND .*title.*I?LIKE '\%baz\%'/) + expect(fuzzy_arel_match.to_sql).to match(/title.+I?LIKE '\%foo\%' AND .*title.*I?LIKE '\%baz\%'/) end end @@ -168,7 +168,7 @@ describe Gitlab::SQL::Pattern do let(:query) { 'foo "really bar" baz' } it 'returns a joining LIKE condition using a AND' do - expect(to_fuzzy_arel.to_sql).to match(/title.+I?LIKE '\%foo\%' AND .*title.*I?LIKE '\%baz\%' AND .*title.*I?LIKE '\%really bar\%'/) + expect(fuzzy_arel_match.to_sql).to match(/title.+I?LIKE '\%foo\%' AND .*title.*I?LIKE '\%baz\%' AND .*title.*I?LIKE '\%really bar\%'/) end end end |