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
bf852074
Commit
bf852074
authored
Apr 08, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
03257247
435c492b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
47 deletions
+79
-47
spec/features/issues/user_uses_quick_actions_spec.rb
spec/features/issues/user_uses_quick_actions_spec.rb
+1
-0
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/issue/duplicate_quick_action_shared_examples.rb
...k_actions/issue/duplicate_quick_action_shared_examples.rb
+34
-0
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/issues/user_uses_quick_actions_spec.rb
View file @
bf852074
...
...
@@ -58,6 +58,7 @@ describe 'Issues > User uses quick actions', :js do
it_behaves_like
'confidential quick action'
it_behaves_like
'remove_due_date quick action'
it_behaves_like
'duplicate quick action'
describe
'adding a due date from note'
do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
...
...
spec/features/merge_request/user_uses_quick_actions_spec.rb
View file @
bf852074
...
...
@@ -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/issue/duplicate_quick_action_shared_examples.rb
View file @
bf852074
# frozen_string_literal: true
shared_examples
'duplicate quick action'
do
context
'mark issue as duplicate'
do
let
(
:original_issue
)
{
create
(
:issue
,
project:
project
)
}
context
'when the current user can update issues'
do
it
'does not create a note, and marks the issue as a duplicate'
do
add_note
(
"/duplicate #
#{
original_issue
.
to_reference
}
"
)
expect
(
page
).
not_to
have_content
"/duplicate
#{
original_issue
.
to_reference
}
"
expect
(
page
).
to
have_content
'Commands applied'
expect
(
page
).
to
have_content
"marked this issue as a duplicate of
#{
original_issue
.
to_reference
}
"
expect
(
issue
.
reload
).
to
be_closed
end
end
context
'when the current user cannot update the issue'
do
let
(
:guest
)
{
create
(
:user
)
}
before
do
project
.
add_guest
(
guest
)
gitlab_sign_out
sign_in
(
guest
)
visit
project_issue_path
(
project
,
issue
)
end
it
'does not create a note, and does not mark the issue as a duplicate'
do
add_note
(
"/duplicate #
#{
original_issue
.
to_reference
}
"
)
expect
(
page
).
not_to
have_content
'Commands applied'
expect
(
page
).
not_to
have_content
"marked this issue as a duplicate of
#{
original_issue
.
to_reference
}
"
expect
(
issue
.
reload
).
to
be_open
end
end
end
end
spec/support/shared_examples/quick_actions/merge_request/wip_quick_action_shared_examples.rb
View file @
bf852074
# 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