Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
6edeff3d
Commit
6edeff3d
authored
Aug 31, 2017
by
Hiroyuki Sato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix MySQL spec errors
parent
c12ab72f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
spec/lib/gitlab/sql/pattern_spec.rb
spec/lib/gitlab/sql/pattern_spec.rb
+5
-5
No files found.
spec/lib/gitlab/sql/pattern_spec.rb
View file @
6edeff3d
...
...
@@ -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
I
LIKE 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
I
LIKE 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment