Commit e351ed2d authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add test that checks actual merge for MWBS feature

parent 2f66969e
...@@ -58,7 +58,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do ...@@ -58,7 +58,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
merge_when_build_succeeds: true) merge_when_build_succeeds: true)
end end
background do let!(:build) do
create(:ci_build, pipeline: pipeline) create(:ci_build, pipeline: pipeline)
end end
...@@ -72,7 +72,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do ...@@ -72,7 +72,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
expect(page).to have_button "Merge When Build Succeeds" 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" expect(page).to have_content "Canceled the automatic merge"
end end
...@@ -82,6 +82,17 @@ feature 'Merge When Build Succeeds', feature: true, js: true do ...@@ -82,6 +82,17 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
click_link "Remove Source Branch When Merged" click_link "Remove Source Branch When Merged"
expect(page).to have_content "The source branch will be removed" expect(page).to have_content "The source branch will be removed"
end 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 end
context 'when build is not active' do context 'when build is not active' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment