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
90a3eb37
Commit
90a3eb37
authored
Apr 04, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
d5474810
e9699cd9
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
88 additions
and
104 deletions
+88
-104
doc/ci/variables/where_variables_can_be_used.md
doc/ci/variables/where_variables_can_be_used.md
+14
-14
spec/features/commits/user_uses_quick_actions_spec.rb
spec/features/commits/user_uses_quick_actions_spec.rb
+1
-22
spec/features/merge_request/user_uses_quick_actions_spec.rb
spec/features/merge_request/user_uses_quick_actions_spec.rb
+2
-68
spec/support/shared_examples/quick_actions/commit/tag_quick_action_shared_examples.rb
.../quick_actions/commit/tag_quick_action_shared_examples.rb
+24
-0
spec/support/shared_examples/quick_actions/merge_request/merge_quick_action_shared_examples.rb
...tions/merge_request/merge_quick_action_shared_examples.rb
+47
-0
No files found.
doc/ci/variables/where_variables_can_be_used.md
View file @
90a3eb37
This diff is collapsed.
Click to expand it.
spec/features/commits/user_uses_quick_actions_spec.rb
View file @
90a3eb37
...
...
@@ -22,27 +22,6 @@ describe 'Commit > User uses quick actions', :js do
let
(
:tag_message
)
{
'Stable release'
}
let
(
:truncated_commit_sha
)
{
Commit
.
truncate_sha
(
commit
.
sha
)
}
it
'tags this commit'
do
add_note
(
"/tag
#{
tag_name
}
#{
tag_message
}
"
)
expect
(
page
).
to
have_content
'Commands applied'
expect
(
page
).
to
have_content
"tagged commit
#{
truncated_commit_sha
}
"
expect
(
page
).
to
have_content
tag_name
visit
project_tag_path
(
project
,
tag_name
)
expect
(
page
).
to
have_content
tag_name
expect
(
page
).
to
have_content
tag_message
expect
(
page
).
to
have_content
truncated_commit_sha
end
describe
'preview'
,
:js
do
it
'removes quick action from note and explains it'
do
preview_note
(
"/tag
#{
tag_name
}
#{
tag_message
}
"
)
expect
(
page
).
not_to
have_content
'/tag'
expect
(
page
).
to
have_content
%{Tags this commit to #{tag_name} with "#{tag_message}"}
expect
(
page
).
to
have_content
tag_name
end
end
it_behaves_like
'tag quick action'
end
end
spec/features/merge_request/user_uses_quick_actions_spec.rb
View file @
90a3eb37
...
...
@@ -56,6 +56,8 @@ describe 'Merge request > User uses quick actions', :js do
project
.
add_maintainer
(
user
)
end
it_behaves_like
'merge 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
...
...
@@ -103,74 +105,6 @@ describe 'Merge request > User uses quick actions', :js do
end
end
describe
'merging the MR from the note'
do
context
'when the current user can merge the MR'
do
before
do
sign_in
(
user
)
visit
project_merge_request_path
(
project
,
merge_request
)
end
it
'merges the MR'
do
add_note
(
"/merge"
)
expect
(
page
).
to
have_content
'Commands applied'
expect
(
merge_request
.
reload
).
to
be_merged
end
end
context
'when the head diff changes in the meanwhile'
do
before
do
merge_request
.
source_branch
=
'another_branch'
merge_request
.
save
sign_in
(
user
)
visit
project_merge_request_path
(
project
,
merge_request
)
end
it
'does not merge the MR'
do
add_note
(
"/merge"
)
expect
(
page
).
not_to
have_content
'Your commands have been executed!'
expect
(
merge_request
.
reload
).
not_to
be_merged
end
end
context
'when the current user cannot merge the MR'
do
before
do
project
.
add_guest
(
guest
)
sign_in
(
guest
)
visit
project_merge_request_path
(
project
,
merge_request
)
end
it
'does not merge the MR'
do
add_note
(
"/merge"
)
expect
(
page
).
not_to
have_content
'Your commands have been executed!'
expect
(
merge_request
.
reload
).
not_to
be_merged
end
end
end
describe
'adding a due date from note'
do
before
do
sign_in
(
user
)
visit
project_merge_request_path
(
project
,
merge_request
)
end
it_behaves_like
'due quick action not available'
end
describe
'removing a due date from note'
do
before
do
sign_in
(
user
)
visit
project_merge_request_path
(
project
,
merge_request
)
end
it_behaves_like
'remove_due_date action not available'
end
describe
'/target_branch command in merge request'
do
let
(
:another_project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:new_url_opts
)
{
{
merge_request:
{
source_branch:
'feature'
}
}
}
...
...
spec/support/shared_examples/quick_actions/commit/tag_quick_action_shared_examples.rb
View file @
90a3eb37
# frozen_string_literal: true
shared_examples
'tag quick action'
do
context
"post note to existing commit"
do
it
'tags this commit'
do
add_note
(
"/tag
#{
tag_name
}
#{
tag_message
}
"
)
expect
(
page
).
to
have_content
'Commands applied'
expect
(
page
).
to
have_content
"tagged commit
#{
truncated_commit_sha
}
"
expect
(
page
).
to
have_content
tag_name
visit
project_tag_path
(
project
,
tag_name
)
expect
(
page
).
to
have_content
tag_name
expect
(
page
).
to
have_content
tag_message
expect
(
page
).
to
have_content
truncated_commit_sha
end
end
context
'preview'
,
:js
do
it
'removes quick action from note and explains it'
do
preview_note
(
"/tag
#{
tag_name
}
#{
tag_message
}
"
)
expect
(
page
).
not_to
have_content
'/tag'
expect
(
page
).
to
have_content
%{Tags this commit to #{tag_name} with "#{tag_message}"}
expect
(
page
).
to
have_content
tag_name
end
end
end
spec/support/shared_examples/quick_actions/merge_request/merge_quick_action_shared_examples.rb
View file @
90a3eb37
# frozen_string_literal: true
shared_examples
'merge quick action'
do
context
'when the current user can merge the MR'
do
before
do
sign_in
(
user
)
visit
project_merge_request_path
(
project
,
merge_request
)
end
it
'merges the MR'
do
add_note
(
"/merge"
)
expect
(
page
).
to
have_content
'Commands applied'
expect
(
merge_request
.
reload
).
to
be_merged
end
end
context
'when the head diff changes in the meanwhile'
do
before
do
merge_request
.
source_branch
=
'another_branch'
merge_request
.
save
sign_in
(
user
)
visit
project_merge_request_path
(
project
,
merge_request
)
end
it
'does not merge the MR'
do
add_note
(
"/merge"
)
expect
(
page
).
not_to
have_content
'Your commands have been executed!'
expect
(
merge_request
.
reload
).
not_to
be_merged
end
end
context
'when the current user cannot merge the MR'
do
before
do
project
.
add_guest
(
guest
)
sign_in
(
guest
)
visit
project_merge_request_path
(
project
,
merge_request
)
end
it
'does not merge the MR'
do
add_note
(
"/merge"
)
expect
(
page
).
not_to
have_content
'Your commands have been executed!'
expect
(
merge_request
.
reload
).
not_to
be_merged
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