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
Léo-Paul Géneau
gitlab-ce
Commits
42fe7e91
Commit
42fe7e91
authored
Apr 03, 2019
by
Alexandru Croitor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract wip quick action to a shared example
parent
d793d4a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
47 deletions
+44
-47
spec/features/merge_request/user_uses_quick_actions_spec.rb
spec/features/merge_request/user_uses_quick_actions_spec.rb
+1
-47
spec/support/shared_examples/quick_actions/merge_request/wip_quick_action_shared_examples.rb
...actions/merge_request/wip_quick_action_shared_examples.rb
+43
-0
No files found.
spec/features/merge_request/user_uses_quick_actions_spec.rb
View file @
42fe7e91
...
...
@@ -58,52 +58,6 @@ describe 'Merge request > User uses quick actions', :js do
it_behaves_like
'merge quick action'
it_behaves_like
'target_branch quick action'
describe
'toggling the WIP prefix in the title from note'
do
context
'when the current user can toggle the WIP prefix'
do
before
do
sign_in
(
user
)
visit
project_merge_request_path
(
project
,
merge_request
)
wait_for_requests
end
it
'adds the WIP: prefix to the title'
do
add_note
(
"/wip"
)
expect
(
page
).
not_to
have_content
'/wip'
expect
(
page
).
to
have_content
'Commands applied'
expect
(
merge_request
.
reload
.
work_in_progress?
).
to
eq
true
end
it
'removes the WIP: prefix from the title'
do
merge_request
.
title
=
merge_request
.
wip_title
merge_request
.
save
add_note
(
"/wip"
)
expect
(
page
).
not_to
have_content
'/wip'
expect
(
page
).
to
have_content
'Commands applied'
expect
(
merge_request
.
reload
.
work_in_progress?
).
to
eq
false
end
end
context
'when the current user cannot toggle the WIP prefix'
do
before
do
project
.
add_guest
(
guest
)
sign_in
(
guest
)
visit
project_merge_request_path
(
project
,
merge_request
)
end
it
'does not change the WIP prefix'
do
add_note
(
"/wip"
)
expect
(
page
).
not_to
have_content
'/wip'
expect
(
page
).
not_to
have_content
'Commands applied'
expect
(
merge_request
.
reload
.
work_in_progress?
).
to
eq
false
end
end
end
it_behaves_like
'wip quick action'
end
end
spec/support/shared_examples/quick_actions/merge_request/wip_quick_action_shared_examples.rb
View file @
42fe7e91
# frozen_string_literal: true
shared_examples
'wip quick action'
do
context
'when the current user can toggle the WIP prefix'
do
before
do
sign_in
(
user
)
visit
project_merge_request_path
(
project
,
merge_request
)
wait_for_requests
end
it
'adds the WIP: prefix to the title'
do
add_note
(
'/wip'
)
expect
(
page
).
not_to
have_content
'/wip'
expect
(
page
).
to
have_content
'Commands applied'
expect
(
merge_request
.
reload
.
work_in_progress?
).
to
eq
true
end
it
'removes the WIP: prefix from the title'
do
merge_request
.
update!
(
title:
merge_request
.
wip_title
)
add_note
(
'/wip'
)
expect
(
page
).
not_to
have_content
'/wip'
expect
(
page
).
to
have_content
'Commands applied'
expect
(
merge_request
.
reload
.
work_in_progress?
).
to
eq
false
end
end
context
'when the current user cannot toggle the WIP prefix'
do
before
do
project
.
add_guest
(
guest
)
sign_in
(
guest
)
visit
project_merge_request_path
(
project
,
merge_request
)
end
it
'does not change the WIP prefix'
do
add_note
(
'/wip'
)
expect
(
page
).
not_to
have_content
'/wip'
expect
(
page
).
not_to
have_content
'Commands applied'
expect
(
merge_request
.
reload
.
work_in_progress?
).
to
eq
false
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