diff options
author | Hiroyuki Sato <sathiroyuki@gmail.com> | 2017-08-31 07:49:19 +0900 |
---|---|---|
committer | Hiroyuki Sato <sathiroyuki@gmail.com> | 2017-08-31 13:43:56 +0900 |
commit | 6edeff3d9cd78d4d89900122e0d66a7c5e53f43f (patch) | |
tree | 655c1c28d7ef0c2b1107cd39cc176ebd502ad421 /spec/lib/gitlab/sql | |
parent | c12ab72f05386903d1af78d0e766ee970af09a44 (diff) | |
download | gitlab-ce-6edeff3d9cd78d4d89900122e0d66a7c5e53f43f.tar.gz |
Fix MySQL spec errors
Diffstat (limited to 'spec/lib/gitlab/sql')
-rw-r--r-- | spec/lib/gitlab/sql/pattern_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/lib/gitlab/sql/pattern_spec.rb b/spec/lib/gitlab/sql/pattern_spec.rb index 0b0e905483f..a780776d48e 100644 --- a/spec/lib/gitlab/sql/pattern_spec.rb +++ b/spec/lib/gitlab/sql/pattern_spec.rb @@ -144,7 +144,7 @@ describe Gitlab::SQL::Pattern do let(:query) { 'foo' } it 'returns a single ILIKE condition' do - expect(to_fuzzy_arel.to_sql).to eq(%("issues"."title" ILIKE '%foo%')) + expect(to_fuzzy_arel.to_sql).to match(/title.*I?LIKE '\%foo\%'/) end end @@ -159,16 +159,16 @@ describe Gitlab::SQL::Pattern do context 'with two words both equal to 3 chars' do let(:query) { 'foo baz' } - it 'returns a joining ILIKE condition using a AND' do - expect(to_fuzzy_arel.to_sql).to eq(%("issues"."title" ILIKE '%foo%' AND "issues"."title" ILIKE '%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\%'/) end end context 'with a multi-word surrounded by double quote and two words' do let(:query) { 'foo "really bar" baz' } - it 'returns a joining ILIKE condition using a AND' do - expect(to_fuzzy_arel.to_sql).to eq(%("issues"."title" ILIKE '%foo%' AND "issues"."title" ILIKE '%baz%' AND "issues"."title" ILIKE '%really bar%')) + 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\%'/) end end end |