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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
42fbae52
Commit
42fbae52
authored
Sep 13, 2021
by
Brett Walker
Committed by
Heinrich Lee Yu
Sep 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs to IssueFinder
parent
5b7fd663
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
3 deletions
+28
-3
spec/finders/issues_finder_spec.rb
spec/finders/issues_finder_spec.rb
+28
-3
No files found.
spec/finders/issues_finder_spec.rb
View file @
42fbae52
...
@@ -567,6 +567,31 @@ RSpec.describe IssuesFinder do
...
@@ -567,6 +567,31 @@ RSpec.describe IssuesFinder do
it
'returns issues with title and description match for search term'
do
it
'returns issues with title and description match for search term'
do
expect
(
issues
).
to
contain_exactly
(
issue1
,
issue2
)
expect
(
issues
).
to
contain_exactly
(
issue1
,
issue2
)
end
end
context
'with anonymous user'
do
let_it_be
(
:public_project
,
reload:
true
)
{
create
(
:project
,
:public
,
group:
subgroup
)
}
let_it_be
(
:issue6
,
reload:
true
)
{
create
(
:issue
,
project:
public_project
,
title:
'tanuki'
)
}
let_it_be
(
:issue7
,
reload:
true
)
{
create
(
:issue
,
project:
public_project
,
title:
'ikunat'
)
}
let
(
:search_user
)
{
nil
}
let
(
:params
)
{
{
search:
'tanuki'
}
}
context
'with disable_anonymous_search feature flag enabled'
do
it
'does not perform search'
do
expect
(
issues
).
to
contain_exactly
(
issue6
,
issue7
)
end
end
context
'with disable_anonymous_search feature flag disabled'
do
before
do
stub_feature_flags
(
disable_anonymous_search:
false
)
end
it
'finds one public issue'
do
expect
(
issues
).
to
contain_exactly
(
issue6
)
end
end
end
end
end
context
'filtering by issue term in title'
do
context
'filtering by issue term in title'
do
...
@@ -1256,7 +1281,7 @@ RSpec.describe IssuesFinder do
...
@@ -1256,7 +1281,7 @@ RSpec.describe IssuesFinder do
end
end
describe
'#use_cte_for_search?'
do
describe
'#use_cte_for_search?'
do
let
(
:finder
)
{
described_class
.
new
(
nil
,
params
)
}
let
(
:finder
)
{
described_class
.
new
(
user
,
params
)
}
context
'when there is no search param'
do
context
'when there is no search param'
do
let
(
:params
)
{
{
attempt_group_search_optimizations:
true
}
}
let
(
:params
)
{
{
attempt_group_search_optimizations:
true
}
}
...
@@ -1275,7 +1300,7 @@ RSpec.describe IssuesFinder do
...
@@ -1275,7 +1300,7 @@ RSpec.describe IssuesFinder do
end
end
context
'when all conditions are met'
do
context
'when all conditions are met'
do
context
"uses group search optimization"
do
context
'uses group search optimization'
do
let
(
:params
)
{
{
search:
'foo'
,
attempt_group_search_optimizations:
true
}
}
let
(
:params
)
{
{
search:
'foo'
,
attempt_group_search_optimizations:
true
}
}
it
'returns true'
do
it
'returns true'
do
...
@@ -1284,7 +1309,7 @@ RSpec.describe IssuesFinder do
...
@@ -1284,7 +1309,7 @@ RSpec.describe IssuesFinder do
end
end
end
end
context
"uses project search optimization"
do
context
'uses project search optimization'
do
let
(
:params
)
{
{
search:
'foo'
,
attempt_project_search_optimizations:
true
}
}
let
(
:params
)
{
{
search:
'foo'
,
attempt_project_search_optimizations:
true
}
}
it
'returns true'
do
it
'returns true'
do
...
...
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