BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
c07a5227
Commit
c07a5227
authored
Nov 14, 2016
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tests to include token symbol
parent
329b03b3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
58 deletions
+70
-58
filter_issues_spec.rb
spec/features/issues/filter_issues_spec.rb
+70
-58
No files found.
spec/features/issues/filter_issues_spec.rb
View file @
c07a5227
...
...
@@ -82,13 +82,19 @@ describe 'Filter issues', feature: true do
multiple_words_label_issue
=
create
(
:issue
,
title:
"Issue with multiple words label"
,
project:
project
)
multiple_words_label_issue
.
labels
<<
multiple_words_label
future_milestone
=
create
(
:milestone
,
title:
"future"
,
project:
project
,
due_date:
Time
.
now
+
1
.
month
)
issue_with_future_milestone
=
create
(
:issue
,
title:
"Issue with future milestone"
,
milestone:
future_milestone
,
project:
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
end
describe
'filter issues by author'
do
context
'only author'
,
js:
true
do
it
'filters issues by searched author'
do
input_filtered_search
(
"author:
#{
user
.
username
}
"
)
input_filtered_search
(
"author:
@
#{
user
.
username
}
"
)
expect_issues_list_count
(
5
)
end
...
...
@@ -103,22 +109,22 @@ describe 'Filter issues', feature: true do
context
'author with other filters'
,
js:
true
do
it
'filters issues by searched author and text'
do
input_filtered_search
(
"author:
#{
user
.
username
}
issue"
)
input_filtered_search
(
"author:
@
#{
user
.
username
}
issue"
)
expect_issues_list_count
(
3
)
end
it
'filters issues by searched author, assignee and text'
do
input_filtered_search
(
"author:
#{
user
.
username
}
assignee:
#{
user
.
username
}
issue"
)
input_filtered_search
(
"author:
@
#{
user
.
username
}
assignee:@
#{
user
.
username
}
issue"
)
expect_issues_list_count
(
3
)
end
it
'filters issues by searched author, assignee, label, and text'
do
input_filtered_search
(
"author:
#{
user
.
username
}
assignee:
#{
user
.
username
}
label:
#{
caps_sensitive_label
.
title
}
issue"
)
input_filtered_search
(
"author:
@
#{
user
.
username
}
assignee:@
#{
user
.
username
}
label:~
#{
caps_sensitive_label
.
title
}
issue"
)
expect_issues_list_count
(
1
)
end
it
'filters issues by searched author, assignee, label, milestone and text'
do
input_filtered_search
(
"author:
#{
user
.
username
}
assignee:
#{
user
.
username
}
label:
#{
caps_sensitive_label
.
title
}
milestone:
#{
milestone
.
title
}
issue"
)
input_filtered_search
(
"author:
@
#{
user
.
username
}
assignee:@
#{
user
.
username
}
label:~
#{
caps_sensitive_label
.
title
}
milestone:%
#{
milestone
.
title
}
issue"
)
expect_issues_list_count
(
1
)
end
end
...
...
@@ -131,12 +137,13 @@ describe 'Filter issues', feature: true do
describe
'filter issues by assignee'
do
context
'only assignee'
,
js:
true
do
it
'filters issues by searched assignee'
do
input_filtered_search
(
"assignee:
#{
user
.
username
}
"
)
input_filtered_search
(
"assignee:
@
#{
user
.
username
}
"
)
expect_issues_list_count
(
5
)
end
it
'filters issues by no assignee'
do
# TODO
input_filtered_search
(
"assignee:none"
)
expect_issues_list_count
(
8
)
end
it
'filters issues by invalid assignee'
do
...
...
@@ -148,27 +155,27 @@ describe 'Filter issues', feature: true do
end
end
context
'assignee with other filters'
,
js:
true
do
it
'filters issues by searched assignee and text'
do
input_filtered_search
(
"assignee:
#{
user
.
username
}
searchTerm"
)
expect_issues_list_count
(
2
)
end
#
context 'assignee with other filters', js: true do
#
it 'filters issues by searched assignee and text' do
# input_filtered_search("assignee:@
#{user.username} searchTerm")
#
expect_issues_list_count(2)
#
end
it
'filters issues by searched assignee, author and text'
do
input_filtered_search
(
"assignee:
#{
user
.
username
}
author:
#{
user
.
username
}
searchTerm"
)
expect_issues_list_count
(
2
)
end
#
it 'filters issues by searched assignee, author and text' do
# input_filtered_search("assignee:@#{user.username} author:@
#{user.username} searchTerm")
#
expect_issues_list_count(2)
#
end
it
'filters issues by searched assignee, author, label, text'
do
input_filtered_search
(
"assignee:
#{
user
.
username
}
author:
#{
user
.
username
}
label:
#{
caps_sensitive_label
.
title
}
searchTerm"
)
expect_issues_list_count
(
1
)
end
#
it 'filters issues by searched assignee, author, label, text' do
# input_filtered_search("assignee:@#{user.username} author:@#{user.username} label:~
#{caps_sensitive_label.title} searchTerm")
#
expect_issues_list_count(1)
#
end
it
'filters issues by searched assignee, author, label, milestone and text'
do
input_filtered_search
(
"assignee:
#{
user
.
username
}
author:
#{
user
.
username
}
label:
#{
caps_sensitive_label
.
title
}
milestone:
#{
milestone
.
title
}
searchTerm"
)
expect_issues_list_count
(
1
)
end
end
#
it 'filters issues by searched assignee, author, label, milestone and text' do
# input_filtered_search("assignee:@#{user.username} author:@#{user.username} label:~#{caps_sensitive_label.title} milestone:%
#{milestone.title} searchTerm")
#
expect_issues_list_count(1)
#
end
#
end
context
'sorting'
,
js:
true
do
# TODO
...
...
@@ -178,12 +185,13 @@ describe 'Filter issues', feature: true do
describe
'filter issues by label'
do
context
'only label'
,
js:
true
do
it
'filters issues by searched label'
do
input_filtered_search
(
"label:
#{
bug_label
.
title
}
"
)
input_filtered_search
(
"label:
~
#{
bug_label
.
title
}
"
)
expect_issues_list_count
(
2
)
end
it
'filters issues by no label'
do
# TODO
input_filtered_search
(
"label:none"
)
expect_issues_list_count
(
9
)
end
it
'filters issues by invalid label'
do
...
...
@@ -191,7 +199,7 @@ describe 'Filter issues', feature: true do
end
it
'filters issues by multiple labels'
do
input_filtered_search
(
"label:
#{
bug_label
.
title
}
label:
#{
caps_sensitive_label
.
title
}
"
)
input_filtered_search
(
"label:
~
#{
bug_label
.
title
}
label:~
#{
caps_sensitive_label
.
title
}
"
)
expect_issues_list_count
(
1
)
end
...
...
@@ -199,13 +207,13 @@ describe 'Filter issues', feature: true do
special_label
=
create
(
:label
,
project:
project
,
title:
'!@#{$%^&*()-+[]<>?/:{}|\}'
)
special_issue
=
create
(
:issue
,
title:
"Issue with special character label"
,
project:
project
)
special_issue
.
labels
<<
special_label
input_filtered_search
(
"label:
#{
special_label
.
title
}
"
)
input_filtered_search
(
"label:
~
#{
special_label
.
title
}
"
)
expect_issues_list_count
(
1
)
end
it
'does not show issues'
do
new_label
=
create
(
:label
,
project:
project
,
title:
"new_label"
)
input_filtered_search
(
"label:
#{
new_label
.
title
}
"
)
input_filtered_search
(
"label:
~
#{
new_label
.
title
}
"
)
expect_no_issues_list
()
end
end
...
...
@@ -216,17 +224,17 @@ describe 'Filter issues', feature: true do
special_multiple_issue
=
create
(
:issue
,
title:
"Issue with special character multiple words label"
,
project:
project
)
special_multiple_issue
.
labels
<<
special_multiple_label
input_filtered_search
(
"label:'
#{
special_multiple_label
.
title
}
'"
)
input_filtered_search
(
"label:
~
'
#{
special_multiple_label
.
title
}
'"
)
expect_issues_list_count
(
1
)
end
it
'single quotes'
do
input_filtered_search
(
"label:'
#{
multiple_words_label
.
title
}
'"
)
input_filtered_search
(
"label:
~
'
#{
multiple_words_label
.
title
}
'"
)
expect_issues_list_count
(
1
)
end
it
'double quotes'
do
input_filtered_search
(
"label:
\"
#{
multiple_words_label
.
title
}
\"
"
)
input_filtered_search
(
"label:
~
\"
#{
multiple_words_label
.
title
}
\"
"
)
expect_issues_list_count
(
1
)
end
...
...
@@ -246,51 +254,51 @@ describe 'Filter issues', feature: true do
single_quotes_label_issue
=
create
(
:issue
,
title:
"Issue with single quotes label"
,
project:
project
)
single_quotes_label_issue
.
labels
<<
single_quotes_label
input_filtered_search
(
"label:
\"
#{
single_quotes_label
.
title
}
\"
"
)
input_filtered_search
(
"label:
~
\"
#{
single_quotes_label
.
title
}
\"
"
)
expect_issues_list_count
(
1
)
end
end
context
'label with other filters'
,
js:
true
do
it
'filters issues by searched label and text'
do
input_filtered_search
(
"label:
#{
caps_sensitive_label
.
title
}
bug"
)
input_filtered_search
(
"label:
~
#{
caps_sensitive_label
.
title
}
bug"
)
expect_issues_list_count
(
1
)
end
it
'filters issues by searched label, author and text'
do
input_filtered_search
(
"label:
#{
caps_sensitive_label
.
title
}
author:
#{
user
.
username
}
bug"
)
input_filtered_search
(
"label:
~
#{
caps_sensitive_label
.
title
}
author:@
#{
user
.
username
}
bug"
)
expect_issues_list_count
(
1
)
end
it
'filters issues by searched label, author, assignee and text'
do
input_filtered_search
(
"label:
#{
caps_sensitive_label
.
title
}
author:
#{
user
.
username
}
assignee:
#{
user
.
username
}
bug"
)
input_filtered_search
(
"label:
~
#{
caps_sensitive_label
.
title
}
author:@
#{
user
.
username
}
assignee:@
#{
user
.
username
}
bug"
)
expect_issues_list_count
(
1
)
end
it
'filters issues by searched label, author, assignee, milestone and text'
do
input_filtered_search
(
"label:
#{
caps_sensitive_label
.
title
}
author:
#{
user
.
username
}
assignee:
#{
user
.
username
}
milestone:
#{
milestone
.
title
}
bug"
)
input_filtered_search
(
"label:
~
#{
caps_sensitive_label
.
title
}
author:@
#{
user
.
username
}
assignee:@
#{
user
.
username
}
milestone:%
#{
milestone
.
title
}
bug"
)
expect_issues_list_count
(
1
)
end
end
context
'multiple labels with other filters'
,
js:
true
do
it
'filters issues by searched label, label2, and text'
do
input_filtered_search
(
"label:
#{
bug_label
.
title
}
label:
#{
caps_sensitive_label
.
title
}
bug"
)
input_filtered_search
(
"label:
~
#{
bug_label
.
title
}
label:~
#{
caps_sensitive_label
.
title
}
bug"
)
expect_issues_list_count
(
1
)
end
it
'filters issues by searched label, label2, author and text'
do
input_filtered_search
(
"label:
#{
bug_label
.
title
}
label:
#{
caps_sensitive_label
.
title
}
author:
#{
user
.
username
}
bug"
)
input_filtered_search
(
"label:
~
#{
bug_label
.
title
}
label:~
#{
caps_sensitive_label
.
title
}
author:@
#{
user
.
username
}
bug"
)
expect_issues_list_count
(
1
)
end
it
'filters issues by searched label, label2, author, assignee and text'
do
input_filtered_search
(
"label:
#{
bug_label
.
title
}
label:
#{
caps_sensitive_label
.
title
}
author:
#{
user
.
username
}
assignee:
#{
user
.
username
}
bug"
)
input_filtered_search
(
"label:
~
#{
bug_label
.
title
}
label:~
#{
caps_sensitive_label
.
title
}
author:@
#{
user
.
username
}
assignee:@
#{
user
.
username
}
bug"
)
expect_issues_list_count
(
1
)
end
it
'filters issues by searched label, label2, author, assignee, milestone and text'
do
input_filtered_search
(
"label:
#{
bug_label
.
title
}
label:
#{
caps_sensitive_label
.
title
}
author:
#{
user
.
username
}
assignee:
#{
user
.
username
}
milestone:
#{
milestone
.
title
}
bug"
)
input_filtered_search
(
"label:
~
#{
bug_label
.
title
}
label:~
#{
caps_sensitive_label
.
title
}
author:@
#{
user
.
username
}
assignee:@
#{
user
.
username
}
milestone:%
#{
milestone
.
title
}
bug"
)
expect_issues_list_count
(
1
)
end
end
...
...
@@ -309,16 +317,18 @@ describe 'Filter issues', feature: true do
describe
'filter issues by milestone'
do
context
'only milestone'
,
js:
true
do
it
'filters issues by searched milestone'
do
input_filtered_search
(
"milestone:
#{
milestone
.
title
}
"
)
input_filtered_search
(
"milestone:
%
#{
milestone
.
title
}
"
)
expect_issues_list_count
(
5
)
end
it
'filters issues by no milestone'
do
# TODO
input_filtered_search
(
"milestone:none"
)
expect_issues_list_count
(
7
)
end
it
'filters issues by upcoming milestones'
do
# TODO
input_filtered_search
(
"milestone:upcoming"
)
expect_issues_list_count
(
1
)
end
it
'filters issues by invalid milestones'
do
...
...
@@ -332,13 +342,13 @@ describe 'Filter issues', feature: true do
it
'filters issues by milestone containing special characters'
do
special_milestone
=
create
(
:milestone
,
title:
'!@\#{$%^&*()}'
,
project:
project
)
create
(
:issue
,
title:
"Issue with special character milestone"
,
project:
project
,
milestone:
special_milestone
)
input_filtered_search
(
'milestone:!@\#{$%^&*()}'
)
input_filtered_search
(
'milestone:
%
!@\#{$%^&*()}'
)
expect_issues_list_count
(
1
)
end
it
'does not show issues'
do
new_milestone
=
create
(
:milestone
,
title:
"new"
,
project:
project
)
input_filtered_search
(
"milestone:
#{
new_milestone
}
"
)
input_filtered_search
(
"milestone:
%
#{
new_milestone
}
"
)
expect_no_issues_list
()
end
end
...
...
@@ -402,57 +412,57 @@ describe 'Filter issues', feature: true do
context
'searched text with other filters'
,
js:
true
do
it
'filters issues by searched text and author'
do
input_filtered_search
(
"bug author:
#{
user
.
username
}
"
)
input_filtered_search
(
"bug author:
@
#{
user
.
username
}
"
)
expect_issues_list_count
(
2
)
end
it
'filters issues by searched text, author and more text'
do
input_filtered_search
(
"bug author:
#{
user
.
username
}
report"
)
input_filtered_search
(
"bug author:
@
#{
user
.
username
}
report"
)
expect_issues_list_count
(
1
)
end
it
'filters issues by searched text, author and assignee'
do
input_filtered_search
(
"bug author:
#{
user
.
username
}
assignee:
#{
user
.
username
}
"
)
input_filtered_search
(
"bug author:
@
#{
user
.
username
}
assignee:@
#{
user
.
username
}
"
)
expect_issues_list_count
(
2
)
end
it
'filters issues by searched text, author, more text and assignee'
do
input_filtered_search
(
"bug author:
#{
user
.
username
}
report assignee:
#{
user
.
username
}
"
)
input_filtered_search
(
"bug author:
@
#{
user
.
username
}
report assignee:@
#{
user
.
username
}
"
)
expect_issues_list_count
(
1
)
end
it
'filters issues by searched text, author, more text, assignee and even more text'
do
input_filtered_search
(
"bug author:
#{
user
.
username
}
report assignee:
#{
user
.
username
}
with"
)
input_filtered_search
(
"bug author:
@
#{
user
.
username
}
report assignee:@
#{
user
.
username
}
with"
)
expect_issues_list_count
(
1
)
end
it
'filters issues by searched text, author, assignee and label'
do
input_filtered_search
(
"bug author:
#{
user
.
username
}
assignee:
#{
user
.
username
}
label:
#{
bug_label
.
title
}
"
)
input_filtered_search
(
"bug author:
@
#{
user
.
username
}
assignee:@
#{
user
.
username
}
label:~
#{
bug_label
.
title
}
"
)
expect_issues_list_count
(
2
)
end
it
'filters issues by searched text, author, text, assignee, text, label and text'
do
input_filtered_search
(
"bug author:
#{
user
.
username
}
report assignee:
#{
user
.
username
}
with label:
#{
bug_label
.
title
}
everything"
)
input_filtered_search
(
"bug author:
@
#{
user
.
username
}
report assignee:@
#{
user
.
username
}
with label:~
#{
bug_label
.
title
}
everything"
)
expect_issues_list_count
(
1
)
end
it
'filters issues by searched text, author, assignee, label and milestone'
do
input_filtered_search
(
"bug author:
#{
user
.
username
}
assignee:
#{
user
.
username
}
label:
#{
bug_label
.
title
}
milestone:
#{
milestone
.
title
}
"
)
input_filtered_search
(
"bug author:
@
#{
user
.
username
}
assignee:@
#{
user
.
username
}
label:~
#{
bug_label
.
title
}
milestone:%
#{
milestone
.
title
}
"
)
expect_issues_list_count
(
2
)
end
it
'filters issues by searched text, author, text, assignee, text, label, text, milestone and text'
do
input_filtered_search
(
"bug author:
#{
user
.
username
}
report assignee:
#{
user
.
username
}
with label:
#{
bug_label
.
title
}
everything milestone:
#{
milestone
.
title
}
you"
)
input_filtered_search
(
"bug author:
@
#{
user
.
username
}
report assignee:@
#{
user
.
username
}
with label:~
#{
bug_label
.
title
}
everything milestone:%
#{
milestone
.
title
}
you"
)
expect_issues_list_count
(
1
)
end
it
'filters issues by searched text, author, assignee, multiple labels and milestone'
do
input_filtered_search
(
"bug author:
#{
user
.
username
}
assignee:
#{
user
.
username
}
label:
#{
bug_label
.
title
}
label:
#{
caps_sensitive_label
.
title
}
milestone:
#{
milestone
.
title
}
"
)
input_filtered_search
(
"bug author:
@
#{
user
.
username
}
assignee:@
#{
user
.
username
}
label:~
#{
bug_label
.
title
}
label:~
#{
caps_sensitive_label
.
title
}
milestone:%
#{
milestone
.
title
}
"
)
expect_issues_list_count
(
1
)
end
it
'filters issues by searched text, author, text, assignee, text, label1, text, label2, text, milestone and text'
do
input_filtered_search
(
"bug author:
#{
user
.
username
}
report assignee:
#{
user
.
username
}
with label:
#{
bug_label
.
title
}
everything label:
#{
caps_sensitive_label
.
title
}
you milestone:
#{
milestone
.
title
}
thought"
)
input_filtered_search
(
"bug author:
@
#{
user
.
username
}
report assignee:@
#{
user
.
username
}
with label:~
#{
bug_label
.
title
}
everything label:~
#{
caps_sensitive_label
.
title
}
you milestone:%
#{
milestone
.
title
}
thought"
)
expect_issues_list_count
(
1
)
end
end
...
...
@@ -462,6 +472,7 @@ describe 'Filter issues', feature: true do
end
end
describe
'RSS feeds'
do
it
'updates atom feed link for project issues'
do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
milestone_title:
''
,
assignee_id:
user
.
id
)
link
=
find
(
'.nav-controls a'
,
text:
'Subscribe'
)
...
...
@@ -489,4 +500,5 @@ describe 'Filter issues', feature: true do
expect
(
auto_discovery_params
).
to
include
(
'milestone_title'
=>
[
''
])
expect
(
auto_discovery_params
).
to
include
(
'assignee_id'
=>
[
user
.
id
.
to_s
])
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