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
Boxiang Sun
gitlab-ce
Commits
7891aec0
Commit
7891aec0
authored
Sep 08, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor merge requests bulk update spec
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
1a18eb59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
52 deletions
+60
-52
spec/features/merge_requests/update_merge_requests_spec.rb
spec/features/merge_requests/update_merge_requests_spec.rb
+60
-52
No files found.
spec/features/merge_requests/update_merge_requests_spec.rb
View file @
7891aec0
...
@@ -16,11 +16,7 @@ feature 'Multiple merge requests updating from merge_requests#index', feature: t
...
@@ -16,11 +16,7 @@ feature 'Multiple merge requests updating from merge_requests#index', feature: t
it
'sets to closed'
do
it
'sets to closed'
do
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
find
(
'#check_all_issues'
).
click
change_status
(
'Closed'
)
find
(
'.js-issue-status'
).
click
find
(
'.dropdown-menu-status a'
,
text:
'Closed'
).
click
click_update_merge_requests_button
expect
(
page
).
to
have_selector
(
'.merge-request'
,
count:
0
)
expect
(
page
).
to
have_selector
(
'.merge-request'
,
count:
0
)
end
end
...
@@ -28,80 +24,92 @@ feature 'Multiple merge requests updating from merge_requests#index', feature: t
...
@@ -28,80 +24,92 @@ feature 'Multiple merge requests updating from merge_requests#index', feature: t
merge_request
.
close
merge_request
.
close
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
,
state:
'closed'
)
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
,
state:
'closed'
)
find
(
'#check_all_issues'
).
click
change_status
(
'Open'
)
find
(
'.js-issue-status'
).
click
find
(
'.dropdown-menu-status a'
,
text:
'Open'
).
click
click_update_merge_requests_button
expect
(
page
).
to
have_selector
(
'.merge-request'
,
count:
0
)
expect
(
page
).
to
have_selector
(
'.merge-request'
,
count:
0
)
end
end
end
end
context
'assignee'
,
js:
true
do
context
'assignee'
,
js:
true
do
it
'updates to current user'
do
context
'set assignee'
do
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
before
do
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
find
(
'#check_all_issues'
).
click
end
click_update_assignee_button
find
(
'.dropdown-menu-user-link'
,
text:
user
.
username
).
click
it
"should update merge request with assignee"
do
click_update_merge_requests_button
change_assignee
(
user
.
name
)
page
.
within
(
'.merge-request .controls'
)
do
page
.
within
(
'.merge-request .controls'
)
do
expect
(
find
(
'.author_link'
)[
"title"
]).
to
have_content
(
user
.
name
)
expect
(
find
(
'.author_link'
)[
"title"
]).
to
have_content
(
user
.
name
)
end
end
end
end
end
it
'updates to unassigned'
do
context
'remove assignee'
do
merge_request
.
assignee
=
user
before
do
merge_request
.
save
merge_request
.
assignee
=
user
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
merge_request
.
save
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
find
(
'#check_all_issues'
).
click
end
click_update_assignee_button
click_link
'Unassigned'
it
"should remove assignee from the merge request"
do
click_update_merge_requests_button
change_assignee
(
'Unassigned'
)
expect
(
find
(
'.merge-request:first-child .controls'
)).
not_to
have_css
(
'.author_link'
)
expect
(
find
(
'.merge-request .controls'
)).
not_to
have_css
(
'.author_link'
)
end
end
end
end
end
context
'milestone'
,
js:
true
do
context
'milestone'
,
js:
true
do
let
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
it
'updates milestone'
do
context
'set milestone'
do
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
before
do
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
find
(
'#check_all_issues'
).
click
end
find
(
'.issues_bulk_update .js-milestone-select'
).
click
find
(
'.dropdown-menu-milestone a'
,
text:
milestone
.
title
).
click
click_update_merge_requests_button
expect
(
find
(
'.merge-request'
)).
to
have_content
milestone
.
title
it
"should update merge request with milestone"
do
change_milestone
(
milestone
.
title
)
expect
(
find
(
'.merge-request'
)).
to
have_content
milestone
.
title
end
end
end
it
'sets to no milestone'
do
context
'unset milestone'
do
merge_request
.
milestone
=
milestone
before
do
merge_request
.
save
merge_request
.
milestone
=
milestone
merge_request
.
save
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
end
expect
(
first
(
'.merge-request'
)).
to
have_content
milestone
.
title
it
"should remove milestone from the merge request"
do
change_milestone
(
"No Milestone"
)
expect
(
find
(
'.merge-request'
)).
not_to
have_content
milestone
.
title
end
end
end
find
(
'#check_all_issues'
).
click
def
change_status
(
text
)
find
(
'.issues_bulk_update .js-milestone-select'
).
click
find
(
'#check_all_issues'
).
click
find
(
'.js-issue-status'
).
click
find
(
'.dropdown-menu-status a'
,
text:
text
).
click
click_update_merge_requests_button
end
find
(
'.dropdown-menu-milestone a'
,
text:
"No Milestone"
).
click
def
change_assignee
(
text
)
click_update_merge_requests_button
find
(
'#check_all_issues'
).
click
find
(
'.js-update-assignee'
).
click
wait_for_ajax
expect
(
find
(
'.merge-request:first-child'
)).
not_to
have_content
milestone
.
title
page
.
within
'.dropdown-menu-user'
do
click_link
text
end
end
click_update_merge_requests_button
end
end
def
click_update_assignee_button
def
change_milestone
(
text
)
find
(
'.js-update-assignee'
).
click
find
(
'#check_all_issues'
).
click
wait_for_ajax
find
(
'.issues_bulk_update .js-milestone-select'
).
click
find
(
'.dropdown-menu-milestone a'
,
text:
text
).
click
click_update_merge_requests_button
end
end
def
click_update_merge_requests_button
def
click_update_merge_requests_button
...
...
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