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
d07ef089
Commit
d07ef089
authored
Nov 21, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename MWPS in user interface and feature tests
parent
bd3ae192
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
15 deletions
+16
-15
app/views/projects/merge_requests/widget/open/_accept.html.haml
...ews/projects/merge_requests/widget/open/_accept.html.haml
+2
-2
spec/features/merge_requests/merge_when_pipeline_succeeds_spec.rb
...tures/merge_requests/merge_when_pipeline_succeeds_spec.rb
+14
-13
No files found.
app/views/projects/merge_requests/widget/open/_accept.html.haml
View file @
d07ef089
...
...
@@ -9,7 +9,7 @@
-
if
@pipeline
&&
@pipeline
.
active?
%span
.btn-group
=
button_tag
class:
"btn btn-create js-merge-button merge_when_build_succeeds"
do
Merge When
Build
Succeeds
Merge When
Pipeline
Succeeds
-
unless
@project
.
only_allow_merge_if_build_succeeds?
=
button_tag
class:
"btn btn-success dropdown-toggle"
,
'data-toggle'
=>
'dropdown'
do
=
icon
(
'caret-down'
)
...
...
@@ -19,7 +19,7 @@
%li
=
link_to
"#"
,
class:
"merge_when_build_succeeds"
do
=
icon
(
'check fw'
)
Merge When
Build
Succeeds
Merge When
Pipeline
Succeeds
%li
=
link_to
"#"
,
class:
"accept_merge_request"
do
=
icon
(
'warning fw'
)
...
...
spec/features/merge_requests/merge_when_
build
_succeeds_spec.rb
→
spec/features/merge_requests/merge_when_
pipeline
_succeeds_spec.rb
View file @
d07ef089
require
'spec_helper'
feature
'Merge When
Build Succeeds'
,
feature:
true
,
js:
true
do
feature
'Merge When
Pipeline Succeeds'
,
:feature
,
:js
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
...
...
@@ -18,7 +18,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
before
{
project
.
team
<<
[
user
,
:master
]
}
context
'when there is active
build
for merge request'
do
context
'when there is active
pipeline
for merge request'
do
background
do
create
(
:ci_build
,
pipeline:
pipeline
)
end
...
...
@@ -28,16 +28,16 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
visit_merge_request
(
merge_request
)
end
it
'displays the Merge When
Build
Succeeds button'
do
expect
(
page
).
to
have_button
"Merge When
Build
Succeeds"
it
'displays the Merge When
Pipeline
Succeeds button'
do
expect
(
page
).
to
have_button
"Merge When
Pipeline
Succeeds"
end
context
"Merge When
Build s
ucceeds enabled"
do
context
"Merge When
Pipeline S
ucceeds enabled"
do
before
do
click_button
"Merge When
Build
Succeeds"
click_button
"Merge When
Pipeline
Succeeds"
end
it
'activates Merge When
Build
Succeeds feature'
do
it
'activates Merge When
Pipeline
Succeeds feature'
do
expect
(
page
).
to
have_link
"Cancel Automatic Merge"
expect
(
page
).
to
have_content
"Set by
#{
user
.
name
}
to be merged automatically when the pipeline succeeds."
...
...
@@ -49,7 +49,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
end
end
context
'when merge when
build
succeeds is enabled'
do
context
'when merge when
pipeline
succeeds is enabled'
do
let
(
:merge_request
)
do
create
(
:merge_request_with_diffs
,
:simple
,
source_project:
project
,
author:
user
,
...
...
@@ -70,7 +70,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
it
'allows to cancel the automatic merge'
do
click_link
"Cancel Automatic Merge"
expect
(
page
).
to
have_button
"Merge When
Build
Succeeds"
expect
(
page
).
to
have_button
"Merge When
Pipeline
Succeeds"
visit_merge_request
(
merge_request
)
# refresh the page
expect
(
page
).
to
have_content
"canceled the automatic merge"
...
...
@@ -83,7 +83,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
expect
(
page
).
to
have_content
"The source branch will be removed"
end
context
'when
build
succeeds'
do
context
'when
pipeline
succeeds'
do
background
{
build
.
success
}
it
'merges merge request'
do
...
...
@@ -95,10 +95,11 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
end
end
context
'when
build
is not active'
do
it
"does not allow to enable merge when
build
succeeds"
do
context
'when
pipeline
is not active'
do
it
"does not allow to enable merge when
pipeline
succeeds"
do
visit_merge_request
(
merge_request
)
expect
(
page
).
not_to
have_link
"Merge When Build Succeeds"
expect
(
page
).
not_to
have_link
'Merge When Pipeline Succeeds'
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