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
Jérome Perrin
gitlab-ce
Commits
2f66969e
Commit
2f66969e
authored
Oct 07, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve merge when builds succeeds specs readability
parent
a98e4081
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
16 deletions
+28
-16
spec/features/merge_requests/merge_when_build_succeeds_spec.rb
...features/merge_requests/merge_when_build_succeeds_spec.rb
+28
-16
No files found.
spec/features/merge_requests/merge_when_build_succeeds_spec.rb
View file @
2f66969e
...
@@ -2,18 +2,26 @@ require 'spec_helper'
...
@@ -2,18 +2,26 @@ require 'spec_helper'
feature
'Merge When Build Succeeds'
,
feature:
true
,
js:
true
do
feature
'Merge When Build Succeeds'
,
feature:
true
,
js:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:merge_request
)
{
create
(
:merge_request_with_diffs
,
source_project:
project
,
author:
user
,
title:
"Bug NS-04"
)
}
before
do
let
(
:merge_request
)
do
project
.
team
<<
[
user
,
:master
]
create
(
:merge_request_with_diffs
,
source_project:
project
,
project
.
enable_ci
author:
user
,
title:
'Bug NS-04'
)
end
let
(
:pipeline
)
do
create
(
:ci_pipeline
,
project:
project
,
sha:
merge_request
.
diff_head_sha
,
ref:
merge_request
.
source_branch
)
end
end
context
"Active build for Merge Request"
do
before
{
project
.
team
<<
[
user
,
:master
]
}
let!
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
sha:
merge_request
.
diff_head_sha
,
ref:
merge_request
.
source_branch
)
}
let!
(
:ci_build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
context
'when there is active build for merge request'
do
background
do
create
(
:ci_build
,
pipeline:
pipeline
)
end
before
do
before
do
login_as
user
login_as
user
...
@@ -41,21 +49,25 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
...
@@ -41,21 +49,25 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
end
end
end
end
context
'
When it
is enabled'
do
context
'
when merge when build succeeds
is enabled'
do
let
(
:merge_request
)
do
let
(
:merge_request
)
do
create
(
:merge_request_with_diffs
,
:simple
,
source_project:
project
,
author:
user
,
create
(
:merge_request_with_diffs
,
:simple
,
source_project:
project
,
merge_user:
user
,
title:
"MepMep"
,
merge_when_build_succeeds:
true
)
author:
user
,
merge_user:
user
,
title:
'MepMep'
,
merge_when_build_succeeds:
true
)
end
end
let!
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
sha:
merge_request
.
diff_head_sha
,
ref:
merge_request
.
source_branch
)
}
background
do
let!
(
:ci_build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
create
(
:ci_build
,
pipeline:
pipeline
)
end
before
do
before
do
login_as
user
login_as
user
visit_merge_request
(
merge_request
)
visit_merge_request
(
merge_request
)
end
end
it
'
cancels
the automatic merge'
do
it
'
allows to cancel
the automatic merge'
do
click_link
"Cancel Automatic Merge"
click_link
"Cancel Automatic Merge"
expect
(
page
).
to
have_button
"Merge When Build Succeeds"
expect
(
page
).
to
have_button
"Merge When Build Succeeds"
...
@@ -72,8 +84,8 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
...
@@ -72,8 +84,8 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
end
end
end
end
context
'
B
uild is not active'
do
context
'
when b
uild is not active'
do
it
"does not allow
for enabling
"
do
it
"does not allow
to enable merge when build succeeds
"
do
visit_merge_request
(
merge_request
)
visit_merge_request
(
merge_request
)
expect
(
page
).
not_to
have_link
"Merge When Build Succeeds"
expect
(
page
).
not_to
have_link
"Merge When Build 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