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
a0498ad0
Commit
a0498ad0
authored
Jul 12, 2021
by
Coung Ngo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `let_it_be` in filtered search feature specs
Improve performance by using `let_it_be` instead of `let` or `let!`
parent
c6982077
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
71 additions
and
70 deletions
+71
-70
ee/spec/features/issues/filtered_search/dropdown_epic_spec.rb
...pec/features/issues/filtered_search/dropdown_epic_spec.rb
+7
-6
ee/spec/features/issues/filtered_search/dropdown_weight_spec.rb
...c/features/issues/filtered_search/dropdown_weight_spec.rb
+4
-3
ee/spec/features/issues/filtered_search/filter_issues_weight_spec.rb
...tures/issues/filtered_search/filter_issues_weight_spec.rb
+7
-15
spec/features/issues/filtered_search/dropdown_assignee_spec.rb
...features/issues/filtered_search/dropdown_assignee_spec.rb
+4
-3
spec/features/issues/filtered_search/dropdown_author_spec.rb
spec/features/issues/filtered_search/dropdown_author_spec.rb
+4
-3
spec/features/issues/filtered_search/dropdown_base_spec.rb
spec/features/issues/filtered_search/dropdown_base_spec.rb
+4
-3
spec/features/issues/filtered_search/dropdown_emoji_spec.rb
spec/features/issues/filtered_search/dropdown_emoji_spec.rb
+5
-4
spec/features/issues/filtered_search/dropdown_hint_spec.rb
spec/features/issues/filtered_search/dropdown_hint_spec.rb
+4
-4
spec/features/issues/filtered_search/dropdown_label_spec.rb
spec/features/issues/filtered_search/dropdown_label_spec.rb
+5
-4
spec/features/issues/filtered_search/dropdown_milestone_spec.rb
...eatures/issues/filtered_search/dropdown_milestone_spec.rb
+5
-5
spec/features/issues/filtered_search/dropdown_release_spec.rb
.../features/issues/filtered_search/dropdown_release_spec.rb
+5
-5
spec/features/issues/filtered_search/recent_searches_spec.rb
spec/features/issues/filtered_search/recent_searches_spec.rb
+5
-4
spec/features/issues/filtered_search/search_bar_spec.rb
spec/features/issues/filtered_search/search_bar_spec.rb
+4
-3
spec/features/issues/filtered_search/visual_tokens_spec.rb
spec/features/issues/filtered_search/visual_tokens_spec.rb
+8
-8
No files found.
ee/spec/features/issues/filtered_search/dropdown_epic_spec.rb
View file @
a0498ad0
...
...
@@ -5,15 +5,16 @@ require 'spec_helper'
RSpec
.
describe
'Dropdown epic'
,
:js
do
include
FilteredSearchHelpers
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
group:
group
)
}
let
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
group:
group
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:epic
)
{
create
(
:epic
,
group:
group
)
}
let_it_be
(
:epic2
)
{
create
(
:epic
,
group:
group
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:filtered_search
)
{
find
(
'.filtered-search'
)
}
let
(
:js_dropdown_epic
)
{
'#js-dropdown-epic'
}
let
(
:filter_dropdown
)
{
find
(
"
#{
js_dropdown_epic
}
.filter-dropdown"
)
}
let!
(
:epic
)
{
create
(
:epic
,
group:
group
)
}
let!
(
:epic2
)
{
create
(
:epic
,
group:
group
)
}
let!
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
before
do
stub_licensed_features
(
epics:
true
)
...
...
ee/spec/features/issues/filtered_search/dropdown_weight_spec.rb
View file @
a0498ad0
...
...
@@ -5,8 +5,10 @@ require 'spec_helper'
RSpec
.
describe
'Dropdown weight'
,
:js
do
include
FilteredSearchHelpers
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:filtered_search
)
{
find
(
'.filtered-search'
)
}
let
(
:js_dropdown_weight
)
{
'#js-dropdown-weight'
}
let
(
:filter_dropdown
)
{
find
(
"
#{
js_dropdown_weight
}
.filter-dropdown"
)
}
...
...
@@ -14,7 +16,6 @@ RSpec.describe 'Dropdown weight', :js do
before
do
project
.
add_maintainer
(
user
)
sign_in
(
user
)
create
(
:issue
,
project:
project
)
visit
project_issues_path
(
project
)
end
...
...
ee/spec/features/issues/filtered_search/filter_issues_weight_spec.rb
View file @
a0498ad0
...
...
@@ -5,8 +5,13 @@ require 'spec_helper'
RSpec
.
describe
'Filter issues weight'
,
:js
do
include
FilteredSearchHelpers
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:user
)
{
create
(
:user
,
name:
'administrator'
,
username:
'root'
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
,
name:
'administrator'
,
username:
'root'
)
}
let_it_be
(
:label
)
{
create
(
:label
,
project:
project
,
title:
'urgent'
)
}
let_it_be
(
:milestone
)
{
create
(
:milestone
,
title:
'version1'
,
project:
project
)
}
let_it_be
(
:issue1
)
{
create
(
:issue
,
project:
project
,
weight:
1
)
}
let_it_be
(
:issue2
)
{
create
(
:issue
,
project:
project
,
weight:
2
,
title:
'Bug report 1'
,
milestone:
milestone
,
author:
user
,
assignees:
[
user
],
labels:
[
label
])
}
let
(
:js_dropdown_weight
)
{
'#js-dropdown-weight'
}
shared_examples
'filters by negated weight'
do
...
...
@@ -30,19 +35,6 @@ RSpec.describe 'Filter issues weight', :js do
project
.
add_maintainer
(
user
)
sign_in
(
user
)
label
=
create
(
:label
,
project:
project
,
title:
'urgent'
)
milestone
=
create
(
:milestone
,
title:
'version1'
,
project:
project
)
create
(
:issue
,
project:
project
,
weight:
1
)
issue
=
create
(
:issue
,
project:
project
,
weight:
2
,
title:
'Bug report 1'
,
milestone:
milestone
,
author:
user
,
assignees:
[
user
])
issue
.
labels
<<
label
visit
project_issues_path
(
project
)
end
...
...
spec/features/issues/filtered_search/dropdown_assignee_spec.rb
View file @
a0498ad0
...
...
@@ -5,15 +5,16 @@ require 'spec_helper'
RSpec
.
describe
'Dropdown assignee'
,
:js
do
include
FilteredSearchHelpers
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:user
)
{
create
(
:user
,
name:
'administrator'
,
username:
'root'
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
,
name:
'administrator'
,
username:
'root'
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:js_dropdown_assignee
)
{
'#js-dropdown-assignee'
}
let
(
:filter_dropdown
)
{
find
(
"
#{
js_dropdown_assignee
}
.filter-dropdown"
)
}
before
do
project
.
add_maintainer
(
user
)
sign_in
(
user
)
create
(
:issue
,
project:
project
)
visit
project_issues_path
(
project
)
end
...
...
spec/features/issues/filtered_search/dropdown_author_spec.rb
View file @
a0498ad0
...
...
@@ -5,15 +5,16 @@ require 'spec_helper'
RSpec
.
describe
'Dropdown author'
,
:js
do
include
FilteredSearchHelpers
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:user
)
{
create
(
:user
,
name:
'administrator'
,
username:
'root'
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
,
name:
'administrator'
,
username:
'root'
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:js_dropdown_author
)
{
'#js-dropdown-author'
}
let
(
:filter_dropdown
)
{
find
(
"
#{
js_dropdown_author
}
.filter-dropdown"
)
}
before
do
project
.
add_maintainer
(
user
)
sign_in
(
user
)
create
(
:issue
,
project:
project
)
visit
project_issues_path
(
project
)
end
...
...
spec/features/issues/filtered_search/dropdown_base_spec.rb
View file @
a0498ad0
...
...
@@ -5,8 +5,10 @@ require 'spec_helper'
RSpec
.
describe
'Dropdown base'
,
:js
do
include
FilteredSearchHelpers
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:user
)
{
create
(
:user
,
name:
'administrator'
,
username:
'root'
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
,
name:
'administrator'
,
username:
'root'
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:filtered_search
)
{
find
(
'.filtered-search'
)
}
let
(
:js_dropdown_assignee
)
{
'#js-dropdown-assignee'
}
let
(
:filter_dropdown
)
{
find
(
"
#{
js_dropdown_assignee
}
.filter-dropdown"
)
}
...
...
@@ -18,7 +20,6 @@ RSpec.describe 'Dropdown base', :js do
before
do
project
.
add_maintainer
(
user
)
sign_in
(
user
)
create
(
:issue
,
project:
project
)
visit
project_issues_path
(
project
)
end
...
...
spec/features/issues/filtered_search/dropdown_emoji_spec.rb
View file @
a0498ad0
...
...
@@ -5,10 +5,11 @@ require 'spec_helper'
RSpec
.
describe
'Dropdown emoji'
,
:js
do
include
FilteredSearchHelpers
let!
(
:project
)
{
create
(
:project
,
:public
)
}
let!
(
:user
)
{
create
(
:user
,
name:
'administrator'
,
username:
'root'
)
}
let!
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let!
(
:award_emoji_star
)
{
create
(
:award_emoji
,
name:
'star'
,
user:
user
,
awardable:
issue
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
)
}
let_it_be
(
:user
)
{
create
(
:user
,
name:
'administrator'
,
username:
'root'
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let_it_be
(
:award_emoji_star
)
{
create
(
:award_emoji
,
name:
'star'
,
user:
user
,
awardable:
issue
)
}
let
(
:filtered_search
)
{
find
(
'.filtered-search'
)
}
let
(
:js_dropdown_emoji
)
{
'#js-dropdown-my-reaction'
}
let
(
:filter_dropdown
)
{
find
(
"
#{
js_dropdown_emoji
}
.filter-dropdown"
)
}
...
...
spec/features/issues/filtered_search/dropdown_hint_spec.rb
View file @
a0498ad0
...
...
@@ -5,8 +5,10 @@ require 'spec_helper'
RSpec
.
describe
'Dropdown hint'
,
:js
do
include
FilteredSearchHelpers
let!
(
:project
)
{
create
(
:project
,
:public
)
}
let!
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:filtered_search
)
{
find
(
'.filtered-search'
)
}
let
(
:js_dropdown_hint
)
{
'#js-dropdown-hint'
}
let
(
:js_dropdown_operator
)
{
'#js-dropdown-operator'
}
...
...
@@ -21,8 +23,6 @@ RSpec.describe 'Dropdown hint', :js do
before
do
project
.
add_maintainer
(
user
)
create
(
:issue
,
project:
project
)
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
end
context
'when user not logged in'
do
...
...
spec/features/issues/filtered_search/dropdown_label_spec.rb
View file @
a0498ad0
...
...
@@ -5,22 +5,23 @@ require 'spec_helper'
RSpec
.
describe
'Dropdown label'
,
:js
do
include
FilteredSearchHelpers
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let_it_be
(
:label
)
{
create
(
:label
,
project:
project
,
title:
'bug-label'
)
}
let
(
:filtered_search
)
{
find
(
'.filtered-search'
)
}
let
(
:filter_dropdown
)
{
find
(
'#js-dropdown-label .filter-dropdown'
)
}
before
do
project
.
add_maintainer
(
user
)
sign_in
(
user
)
create
(
:issue
,
project:
project
)
visit
project_issues_path
(
project
)
end
describe
'behavior'
do
it
'loads all the labels when opened'
do
create
(
:label
,
project:
project
,
title:
'bug-label'
)
filtered_search
.
set
(
'label:='
)
expect_filtered_search_dropdown_results
(
filter_dropdown
,
1
)
...
...
spec/features/issues/filtered_search/dropdown_milestone_spec.rb
View file @
a0498ad0
...
...
@@ -5,10 +5,11 @@ require 'spec_helper'
RSpec
.
describe
'Dropdown milestone'
,
:js
do
include
FilteredSearchHelpers
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:milestone
)
{
create
(
:milestone
,
title:
'v1.0'
,
project:
project
)
}
let!
(
:uppercase_milestone
)
{
create
(
:milestone
,
title:
'CAP_MILESTONE'
,
project:
project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:milestone
)
{
create
(
:milestone
,
title:
'v1.0'
,
project:
project
)
}
let_it_be
(
:uppercase_milestone
)
{
create
(
:milestone
,
title:
'CAP_MILESTONE'
,
project:
project
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:filtered_search
)
{
find
(
'.filtered-search'
)
}
let
(
:filter_dropdown
)
{
find
(
'#js-dropdown-milestone .filter-dropdown'
)
}
...
...
@@ -16,7 +17,6 @@ RSpec.describe 'Dropdown milestone', :js do
before
do
project
.
add_maintainer
(
user
)
sign_in
(
user
)
create
(
:issue
,
project:
project
)
visit
project_issues_path
(
project
)
end
...
...
spec/features/issues/filtered_search/dropdown_release_spec.rb
View file @
a0498ad0
...
...
@@ -5,10 +5,11 @@ require 'spec_helper'
RSpec
.
describe
'Dropdown release'
,
:js
do
include
FilteredSearchHelpers
let!
(
:project
)
{
create
(
:project
,
:repository
)
}
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:release
)
{
create
(
:release
,
tag:
'v1.0'
,
project:
project
)
}
let!
(
:crazy_release
)
{
create
(
:release
,
tag:
'☺!/"#%&\'{}+,-.<>;=@]_`{|}🚀'
,
project:
project
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:release
)
{
create
(
:release
,
tag:
'v1.0'
,
project:
project
)
}
let_it_be
(
:crazy_release
)
{
create
(
:release
,
tag:
'☺!/"#%&\'{}+,-.<>;=@]_`{|}🚀'
,
project:
project
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:filtered_search
)
{
find
(
'.filtered-search'
)
}
let
(
:filter_dropdown
)
{
find
(
'#js-dropdown-release .filter-dropdown'
)
}
...
...
@@ -16,7 +17,6 @@ RSpec.describe 'Dropdown release', :js do
before
do
project
.
add_maintainer
(
user
)
sign_in
(
user
)
create
(
:issue
,
project:
project
)
visit
project_issues_path
(
project
)
end
...
...
spec/features/issues/filtered_search/recent_searches_spec.rb
View file @
a0498ad0
...
...
@@ -6,14 +6,15 @@ RSpec.describe 'Recent searches', :js do
include
FilteredSearchHelpers
include
MobileHelpers
let
(
:project_1
)
{
create
(
:project
,
:public
)
}
let
(
:project_2
)
{
create
(
:project
,
:public
)
}
let_it_be
(
:project_1
)
{
create
(
:project
,
:public
)
}
let_it_be
(
:project_2
)
{
create
(
:project
,
:public
)
}
let_it_be
(
:issue_1
)
{
create
(
:issue
,
project:
project_1
)
}
let_it_be
(
:issue_2
)
{
create
(
:issue
,
project:
project_2
)
}
let
(
:project_1_local_storage_key
)
{
"
#{
project_1
.
full_path
}
-issue-recent-searches"
}
before
do
Capybara
.
ignore_hidden_elements
=
false
create
(
:issue
,
project:
project_1
)
create
(
:issue
,
project:
project_2
)
# Visit any fast-loading page so we can clear local storage without a DOM exception
visit
'/404'
...
...
spec/features/issues/filtered_search/search_bar_spec.rb
View file @
a0498ad0
...
...
@@ -5,14 +5,15 @@ require 'spec_helper'
RSpec
.
describe
'Search bar'
,
:js
do
include
FilteredSearchHelpers
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:filtered_search
)
{
find
(
'.filtered-search'
)
}
before
do
project
.
add_maintainer
(
user
)
sign_in
(
user
)
create
(
:issue
,
project:
project
)
visit
project_issues_path
(
project
)
end
...
...
spec/features/issues/filtered_search/visual_tokens_spec.rb
View file @
a0498ad0
...
...
@@ -5,13 +5,14 @@ require 'spec_helper'
RSpec
.
describe
'Visual tokens'
,
:js
do
include
FilteredSearchHelpers
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:user
)
{
create
(
:user
,
name:
'administrator'
,
username:
'root'
)
}
let!
(
:user_rock
)
{
create
(
:user
,
name:
'The Rock'
,
username:
'rock'
)
}
let!
(
:milestone_nine
)
{
create
(
:milestone
,
title:
'9.0'
,
project:
project
)
}
let!
(
:milestone_ten
)
{
create
(
:milestone
,
title:
'10.0'
,
project:
project
)
}
let!
(
:label
)
{
create
(
:label
,
project:
project
,
title:
'abc'
)
}
let!
(
:cc_label
)
{
create
(
:label
,
project:
project
,
title:
'Community Contribution'
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
,
name:
'administrator'
,
username:
'root'
)
}
let_it_be
(
:user_rock
)
{
create
(
:user
,
name:
'The Rock'
,
username:
'rock'
)
}
let_it_be
(
:milestone_nine
)
{
create
(
:milestone
,
title:
'9.0'
,
project:
project
)
}
let_it_be
(
:milestone_ten
)
{
create
(
:milestone
,
title:
'10.0'
,
project:
project
)
}
let_it_be
(
:label
)
{
create
(
:label
,
project:
project
,
title:
'abc'
)
}
let_it_be
(
:cc_label
)
{
create
(
:label
,
project:
project
,
title:
'Community Contribution'
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:filtered_search
)
{
find
(
'.filtered-search'
)
}
let
(
:filter_author_dropdown
)
{
find
(
"#js-dropdown-author .filter-dropdown"
)
}
...
...
@@ -27,7 +28,6 @@ RSpec.describe 'Visual tokens', :js do
project
.
add_user
(
user
,
:maintainer
)
project
.
add_user
(
user_rock
,
:maintainer
)
sign_in
(
user
)
create
(
:issue
,
project:
project
)
set_cookie
(
'sidebar_collapsed'
,
'true'
)
...
...
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