1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Merge requests > User merges immediately', :js, feature_category: :code_review_workflow do
let(:project) { create(:project, :public, :repository) }
let(:user) { project.creator }
let!(:merge_request) do
create(
:merge_request_with_diffs,
source_project: project,
author: user,
title: 'Bug NS-04',
head_pipeline: pipeline,
source_branch: pipeline.ref
)
end
let(:pipeline) do
create(
:ci_pipeline,
project: project,
ref: 'master',
sha: project.repository.commit('master').id
)
end
context 'when there is active pipeline for merge request' do
before do
create(:ci_build, pipeline: pipeline)
project.add_maintainer(user)
sign_in(user)
visit project_merge_request_path(project, merge_request)
end
it 'enables merge immediately' do
wait_for_requests
page.within '[data-testid="ready_to_merge_state"]' do
find('.dropdown-toggle').click
Sidekiq::Testing.fake! do
click_button 'Merge immediately'
end
end
expect(find('[data-testid="merging-state"]')).to have_content('Merging!')
wait_for_requests
end
end
end
|