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
afd6bcb9
Commit
afd6bcb9
authored
Jan 21, 2017
by
Grzegorz Bizon
Committed by
Jacob Schatz
Jan 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend feature tests for merge when pipeline succeeds
parent
62cb179e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
9 deletions
+51
-9
spec/features/merge_requests/merge_when_pipeline_succeeds_spec.rb
...tures/merge_requests/merge_when_pipeline_succeeds_spec.rb
+51
-9
No files found.
spec/features/merge_requests/merge_when_pipeline_succeeds_spec.rb
View file @
afd6bcb9
...
@@ -32,21 +32,63 @@ feature 'Merge When Pipeline Succeeds', :feature, :js do
...
@@ -32,21 +32,63 @@ feature 'Merge When Pipeline Succeeds', :feature, :js do
expect
(
page
).
to
have_button
"Merge When Pipeline Succeeds"
expect
(
page
).
to
have_button
"Merge When Pipeline Succeeds"
end
end
context
"Merge When Pipeline Succeeds enabled"
do
describe
'enabling Merge When Pipeline Succeeds'
do
before
do
shared_examples
'Merge When Pipeline Succeeds activator'
do
it
'activates the Merge When Pipeline Succeeds feature'
do
click_button
"Merge When Pipeline Succeeds"
click_button
"Merge When Pipeline Succeeds"
end
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."
expect
(
page
).
to
have_content
"Set by
#{
user
.
name
}
to be merged automatically when the pipeline succeeds."
expect
(
page
).
to
have_content
"The source branch will not be removed."
expect
(
page
).
to
have_content
"The source branch will not be removed."
expect
(
page
).
to
have_link
"Cancel Automatic Merge"
visit_merge_request
(
merge_request
)
# Needed to refresh the page
visit_merge_request
(
merge_request
)
# Needed to refresh the page
expect
(
page
).
to
have_content
/enabled an automatic merge when the pipeline for \h{8} succeeds/i
expect
(
page
).
to
have_content
/enabled an automatic merge when the pipeline for \h{8} succeeds/i
end
end
end
end
context
"when enabled immediately"
do
it_behaves_like
'Merge When Pipeline Succeeds activator'
end
context
'when enabled after pipeline status changed'
do
before
do
pipeline
.
run!
# We depend on merge request widget being reloaded
# so we have to wait for asynchronous call to reload it
# and have_content expectation handles that.
#
expect
(
page
).
to
have_content
"Pipeline #
#{
pipeline
.
id
}
running"
end
it_behaves_like
'Merge When Pipeline Succeeds activator'
end
context
'when enabled after it was previously canceled'
do
before
do
click_button
"Merge When Pipeline Succeeds"
click_link
"Cancel Automatic Merge"
end
it_behaves_like
'Merge When Pipeline Succeeds activator'
end
context
'when it was enabled and then canceled'
do
let
(
:merge_request
)
do
create
(
:merge_request_with_diffs
,
:merge_when_build_succeeds
,
source_project:
project
,
title:
'Bug NS-04'
,
author:
user
,
merge_user:
user
)
end
before
do
click_link
"Cancel Automatic Merge"
end
it_behaves_like
'Merge When Pipeline Succeeds activator'
end
end
end
end
context
'when merge when pipeline succeeds is enabled'
do
context
'when merge when pipeline succeeds is enabled'
do
...
...
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