summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-10-07 10:10:46 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-10-07 10:10:46 +0200
commite351ed2d11b611bf06eba8d64d2549fbf60fb605 (patch)
tree4a0d89c10b01dda792f95bb95221d17d06258677
parent2f66969e43d25192017ebbe4ff56df213a2dae3f (diff)
downloadgitlab-ce-e351ed2d11b611bf06eba8d64d2549fbf60fb605.tar.gz
Add test that checks actual merge for MWBS feature
-rw-r--r--spec/features/merge_requests/merge_when_build_succeeds_spec.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/features/merge_requests/merge_when_build_succeeds_spec.rb b/spec/features/merge_requests/merge_when_build_succeeds_spec.rb
index 8b6544269a7..bc2b0ff3e2c 100644
--- a/spec/features/merge_requests/merge_when_build_succeeds_spec.rb
+++ b/spec/features/merge_requests/merge_when_build_succeeds_spec.rb
@@ -58,7 +58,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
merge_when_build_succeeds: true)
end
- background do
+ let!(:build) do
create(:ci_build, pipeline: pipeline)
end
@@ -72,7 +72,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
expect(page).to have_button "Merge When Build Succeeds"
- visit_merge_request(merge_request) # Needed to refresh the page
+ visit_merge_request(merge_request) # refresh the page
expect(page).to have_content "Canceled the automatic merge"
end
@@ -82,6 +82,17 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
click_link "Remove Source Branch When Merged"
expect(page).to have_content "The source branch will be removed"
end
+
+ context 'when build succeeds' do
+ background { build.success }
+
+ it 'merges merge request' do
+ visit_merge_request(merge_request) # refresh the page
+
+ expect(page).to have_content 'The changes were merged'
+ expect(merge_request.reload).to be_merged
+ end
+ end
end
context 'when build is not active' do