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
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
Hide 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'
feature
'Merge When Build Succeeds'
,
feature:
true
,
js:
true
do
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"
)
}
let
(
:merge_request
)
do
create
(
:merge_request_with_diffs
,
source_project:
project
,
author:
user
,
title:
'Bug NS-04'
)
end
before
do
project
.
team
<<
[
user
,
:master
]
project
.
enable_ci
let
(
:pipeline
)
do
create
(
:ci_pipeline
,
project:
project
,
sha:
merge_request
.
diff_head_sha
,
ref:
merge_request
.
source_branch
)
end
context
"Active build for Merge Request"
do
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
)
}
before
{
project
.
team
<<
[
user
,
:master
]
}
context
'when there is active build for merge request'
do
background
do
create
(
:ci_build
,
pipeline:
pipeline
)
end
before
do
login_as
user
...
...
@@ -41,21 +49,25 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
end
end
context
'
When it
is enabled'
do
context
'
when merge when build succeeds
is enabled'
do
let
(
:merge_request
)
do
create
(
:merge_request_with_diffs
,
:simple
,
source_project:
project
,
author:
user
,
merge_user:
user
,
title:
"MepMep"
,
merge_when_build_succeeds:
true
)
create
(
:merge_request_with_diffs
,
:simple
,
source_project:
project
,
author:
user
,
merge_user:
user
,
title:
'MepMep'
,
merge_when_build_succeeds:
true
)
end
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
)
}
background
do
create
(
:ci_build
,
pipeline:
pipeline
)
end
before
do
login_as
user
visit_merge_request
(
merge_request
)
end
it
'
cancels
the automatic merge'
do
it
'
allows to cancel
the automatic merge'
do
click_link
"Cancel Automatic Merge"
expect
(
page
).
to
have_button
"Merge When Build Succeeds"
...
...
@@ -72,8 +84,8 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
end
end
context
'
B
uild is not active'
do
it
"does not allow
for enabling
"
do
context
'
when b
uild is not active'
do
it
"does not allow
to enable merge when build succeeds
"
do
visit_merge_request
(
merge_request
)
expect
(
page
).
not_to
have_link
"Merge When Build Succeeds"
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