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
iv
gitlab-ce
Commits
d18e407c
Commit
d18e407c
authored
Jun 23, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests to check fixes
parent
3d5172b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
148 additions
and
3 deletions
+148
-3
spec/features/issues/bulk_assignment_labels_spec.rb
spec/features/issues/bulk_assignment_labels_spec.rb
+148
-3
No files found.
spec/features/issues/bulk_assignment_labels_spec.rb
View file @
d18e407c
...
...
@@ -10,7 +10,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
let!
(
:bug
)
{
create
(
:label
,
project:
project
,
title:
'bug'
)
}
let!
(
:feature
)
{
create
(
:label
,
project:
project
,
title:
'feature'
)
}
context
'as a allowed user'
,
js:
true
do
context
'as a
n
allowed user'
,
js:
true
do
before
do
project
.
team
<<
[
user
,
:master
]
...
...
@@ -164,6 +164,133 @@ feature 'Issues > Labels bulk assignment', feature: true do
end
end
end
context
'toggling a milestone'
do
let!
(
:milestone
)
{
create
(
:milestone
,
project:
project
,
title:
'First Release'
)
}
context
'setting a milestone'
do
before
do
issue1
.
labels
<<
bug
issue2
.
labels
<<
feature
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
end
it
'labels are kept'
do
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
expect
(
find
(
"#issue_
#{
issue2
.
id
}
"
)).
to
have_content
'feature'
check
'check_all_issues'
open_milestone_dropdown
([
'First Release'
])
update_issues
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'First Release'
expect
(
find
(
"#issue_
#{
issue2
.
id
}
"
)).
to
have_content
'feature'
expect
(
find
(
"#issue_
#{
issue2
.
id
}
"
)).
to
have_content
'First Release'
end
end
context
'setting a milestone and adding another label'
do
before
do
issue1
.
labels
<<
bug
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
end
it
'existing label is kept and new label is present'
do
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
check
'check_all_issues'
open_milestone_dropdown
[
'First Release'
]
open_labels_dropdown
[
'feature'
]
update_issues
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'feature'
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'First Release'
expect
(
find
(
"#issue_
#{
issue2
.
id
}
"
)).
to
have_content
'feature'
expect
(
find
(
"#issue_
#{
issue2
.
id
}
"
)).
to
have_content
'First Release'
end
end
context
'setting a milestone and removing existing label'
do
before
do
issue1
.
labels
<<
bug
issue1
.
labels
<<
feature
issue2
.
labels
<<
feature
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
end
it
'existing label is kept and new label is present'
do
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
expect
(
find
(
"#issue_
#{
issue2
.
id
}
"
)).
to
have_content
'feature'
check
'check_all_issues'
open_milestone_dropdown
[
'First Release'
]
unmark_labels_in_dropdown
[
'feature'
]
update_issues
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
not_to
have_content
'feature'
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'First Release'
expect
(
find
(
"#issue_
#{
issue2
.
id
}
"
)).
not_to
have_content
'feature'
expect
(
find
(
"#issue_
#{
issue2
.
id
}
"
)).
to
have_content
'First Release'
end
end
context
'unsetting a milestone'
do
before
do
issue1
.
milestone
=
milestone
issue2
.
milestone
=
milestone
issue1
.
save
issue2
.
save
issue1
.
labels
<<
bug
issue2
.
labels
<<
feature
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
end
it
'labels are kept'
do
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'First Release'
expect
(
find
(
"#issue_
#{
issue2
.
id
}
"
)).
to
have_content
'feature'
expect
(
find
(
"#issue_
#{
issue2
.
id
}
"
)).
to
have_content
'First Release'
check
'check_all_issues'
open_milestone_dropdown
([
'No Milestone'
])
update_issues
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
not_to
have_content
'First Release'
expect
(
find
(
"#issue_
#{
issue2
.
id
}
"
)).
to
have_content
'feature'
expect
(
find
(
"#issue_
#{
issue2
.
id
}
"
)).
not_to
have_content
'First Release'
end
end
end
context
'toggling checked issues'
do
before
do
issue1
.
labels
<<
bug
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
end
it
do
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
check_issue
issue1
open_labels_dropdown
[
'feature'
]
uncheck_issue
issue1
check_issue
issue1
update_issues
sleep
1
# needed
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
to
have_content
'bug'
expect
(
find
(
"#issue_
#{
issue1
.
id
}
"
)).
not_to
have_content
'feature'
end
end
end
context
'as a guest'
do
...
...
@@ -181,6 +308,16 @@ feature 'Issues > Labels bulk assignment', feature: true do
end
end
def
open_milestone_dropdown
(
items
=
[])
page
.
within
(
'.issues_bulk_update'
)
do
click_button
'Milestone'
wait_for_ajax
items
.
map
do
|
item
|
click_link
item
end
end
end
def
open_labels_dropdown
(
items
=
[],
unmark
=
false
)
page
.
within
(
'.issues_bulk_update'
)
do
click_button
'Label'
...
...
@@ -201,12 +338,20 @@ feature 'Issues > Labels bulk assignment', feature: true do
open_labels_dropdown
(
items
,
true
)
end
def
check_issue
(
issue
)
def
check_issue
(
issue
,
uncheck
=
false
)
page
.
within
(
'.issues-list'
)
do
check
"selected_issue_
#{
issue
.
id
}
"
if
uncheck
uncheck
"selected_issue_
#{
issue
.
id
}
"
else
check
"selected_issue_
#{
issue
.
id
}
"
end
end
end
def
uncheck_issue
(
issue
)
check_issue
(
issue
,
true
)
end
def
update_issues
click_button
'Update issues'
wait_for_ajax
...
...
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