summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/quick_actions/merge_request/merge_quick_action_shared_examples.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/shared_examples/quick_actions/merge_request/merge_quick_action_shared_examples.rb')
-rw-r--r--spec/support/shared_examples/quick_actions/merge_request/merge_quick_action_shared_examples.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/support/shared_examples/quick_actions/merge_request/merge_quick_action_shared_examples.rb b/spec/support/shared_examples/quick_actions/merge_request/merge_quick_action_shared_examples.rb
index fa163b54405..e0edbc5637a 100644
--- a/spec/support/shared_examples/quick_actions/merge_request/merge_quick_action_shared_examples.rb
+++ b/spec/support/shared_examples/quick_actions/merge_request/merge_quick_action_shared_examples.rb
@@ -10,10 +10,27 @@ RSpec.shared_examples 'merge quick action' do
it 'merges the MR', :sidekiq_might_not_need_inline do
add_note("/merge")
- expect(page).to have_content 'Scheduled to merge this merge request when the pipeline succeeds.'
+ expect(page).to have_content 'Merged this merge request.'
expect(merge_request.reload).to be_merged
end
+
+ context 'when auto merge is avialable' do
+ before do
+ create(:ci_pipeline, :detached_merge_request_pipeline,
+ project: project, merge_request: merge_request)
+ merge_request.update_head_pipeline
+ end
+
+ it 'schedules to merge the MR' do
+ add_note("/merge")
+
+ expect(page).to have_content "Scheduled to merge this merge request (Merge when pipeline succeeds)."
+
+ expect(merge_request.reload).to be_auto_merge_enabled
+ expect(merge_request.reload).not_to be_merged
+ end
+ end
end
context 'when the head diff changes in the meanwhile' do