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
3f3e1475
Commit
3f3e1475
authored
Apr 08, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
32cf914f
6844ba2d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
61 deletions
+60
-61
danger/roulette/Dangerfile
danger/roulette/Dangerfile
+4
-2
spec/features/issues/user_uses_quick_actions_spec.rb
spec/features/issues/user_uses_quick_actions_spec.rb
+2
-59
spec/support/shared_examples/quick_actions/issue/create_merge_request_quick_action_shared_examples.rb
...ssue/create_merge_request_quick_action_shared_examples.rb
+54
-0
No files found.
danger/roulette/Dangerfile
View file @
3f3e1475
...
...
@@ -31,13 +31,15 @@ MARKDOWN
def
spin
(
team
,
project
,
category
)
reviewers
=
team
.
select
{
|
member
|
member
.
reviewer?
(
project
,
category
)
}
traintainers
=
team
.
select
{
|
member
|
member
.
traintainer?
(
project
,
category
)
}
maintainers
=
team
.
select
{
|
member
|
member
.
maintainer?
(
project
,
category
)
}
# TODO: filter out people who are currently not in the office
# TODO: take CODEOWNERS into account?
reviewer
=
reviewers
[
rand
(
reviewers
.
size
)]
maintainer
=
maintainers
[
rand
(
maintainers
.
size
)]
# Make traintainers have triple the chance to be picked as a reviewer
reviewer
=
(
reviewers
+
traintainers
+
traintainers
).
sample
maintainer
=
maintainers
.
sample
"|
#{
helper
.
label_for_category
(
category
)
}
|
#{
reviewer
&
.
markdown_name
}
|
#{
maintainer
&
.
markdown_name
}
|"
end
...
...
spec/features/issues/user_uses_quick_actions_spec.rb
View file @
3f3e1475
...
...
@@ -42,7 +42,7 @@ describe 'Issues > User uses quick actions', :js do
describe
'issue-only commands'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
due_date:
Date
.
new
(
2016
,
8
,
28
))
}
before
do
...
...
@@ -59,6 +59,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'
it_behaves_like
'create_merge_request quick action'
describe
'adding a due date from note'
do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
...
...
@@ -317,63 +318,5 @@ describe 'Issues > User uses quick actions', :js do
end
end
end
describe
'create a merge request starting from an issue'
do
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
def
expect_mr_quickaction
(
success
)
expect
(
page
).
to
have_content
'Commands applied'
if
success
expect
(
page
).
to
have_content
'created merge request'
else
expect
(
page
).
not_to
have_content
'created merge request'
end
end
it
"doesn't create a merge request when the branch name is invalid"
do
add_note
(
"/create_merge_request invalid branch name"
)
wait_for_requests
expect_mr_quickaction
(
false
)
end
it
"doesn't create a merge request when a branch with that name already exists"
do
add_note
(
"/create_merge_request feature"
)
wait_for_requests
expect_mr_quickaction
(
false
)
end
it
'creates a new merge request using issue iid and title as branch name when the branch name is empty'
do
add_note
(
"/create_merge_request"
)
wait_for_requests
expect_mr_quickaction
(
true
)
created_mr
=
project
.
merge_requests
.
last
expect
(
created_mr
.
source_branch
).
to
eq
(
issue
.
to_branch_name
)
visit
project_merge_request_path
(
project
,
created_mr
)
expect
(
page
).
to
have_content
%{WIP: Resolve "#{issue.title}"}
end
it
'creates a merge request using the given branch name'
do
branch_name
=
'1-feature'
add_note
(
"/create_merge_request
#{
branch_name
}
"
)
expect_mr_quickaction
(
true
)
created_mr
=
project
.
merge_requests
.
last
expect
(
created_mr
.
source_branch
).
to
eq
(
branch_name
)
visit
project_merge_request_path
(
project
,
created_mr
)
expect
(
page
).
to
have_content
%{WIP: Resolve "#{issue.title}"}
end
end
end
end
spec/support/shared_examples/quick_actions/issue/create_merge_request_quick_action_shared_examples.rb
View file @
3f3e1475
# frozen_string_literal: true
shared_examples
'create_merge_request quick action'
do
context
'create a merge request starting from an issue'
do
def
expect_mr_quickaction
(
success
)
expect
(
page
).
to
have_content
'Commands applied'
if
success
expect
(
page
).
to
have_content
'created merge request'
else
expect
(
page
).
not_to
have_content
'created merge request'
end
end
it
"doesn't create a merge request when the branch name is invalid"
do
add_note
(
"/create_merge_request invalid branch name"
)
wait_for_requests
expect_mr_quickaction
(
false
)
end
it
"doesn't create a merge request when a branch with that name already exists"
do
add_note
(
"/create_merge_request feature"
)
wait_for_requests
expect_mr_quickaction
(
false
)
end
it
'creates a new merge request using issue iid and title as branch name when the branch name is empty'
do
add_note
(
"/create_merge_request"
)
wait_for_requests
expect_mr_quickaction
(
true
)
created_mr
=
project
.
merge_requests
.
last
expect
(
created_mr
.
source_branch
).
to
eq
(
issue
.
to_branch_name
)
visit
project_merge_request_path
(
project
,
created_mr
)
expect
(
page
).
to
have_content
%{WIP: Resolve "#{issue.title}"}
end
it
'creates a merge request using the given branch name'
do
branch_name
=
'1-feature'
add_note
(
"/create_merge_request
#{
branch_name
}
"
)
expect_mr_quickaction
(
true
)
created_mr
=
project
.
merge_requests
.
last
expect
(
created_mr
.
source_branch
).
to
eq
(
branch_name
)
visit
project_merge_request_path
(
project
,
created_mr
)
expect
(
page
).
to
have_content
%{WIP: Resolve "#{issue.title}"}
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