gitlab-org--gitlab-foss/spec/features/merge_request/user_merges_immediately_spec.rb

47 lines
1.3 KiB
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'spec_helper'
2017-01-22 07:37:05 -05:00
RSpec.describe 'Merge requests > User merges immediately', :js do
let(:project) { create(:project, :public, :repository) }
let(:user) { project.creator }
2017-03-22 15:36:14 -04:00
let!(:merge_request) do
2017-01-22 07:37:05 -05:00
create(:merge_request_with_diffs, source_project: project,
author: user,
2017-03-22 15:36:14 -04:00
title: 'Bug NS-04',
head_pipeline: pipeline,
source_branch: pipeline.ref)
2017-01-22 07:37:05 -05:00
end
2017-01-22 07:37:05 -05:00
let(:pipeline) do
create(:ci_pipeline, project: project,
2017-03-22 15:36:14 -04:00
ref: 'master',
sha: project.repository.commit('master').id)
2017-01-22 07:37:05 -05:00
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)
2017-01-22 07:37:05 -05:00
end
it 'enables merge immediately' do
wait_for_requests
2017-01-22 07:37:05 -05:00
page.within '.mr-widget-body' do
find('.dropdown-toggle').click
Sidekiq::Testing.fake! do
click_link 'Merge immediately'
2017-01-22 07:37:05 -05:00
expect(find('.accept-merge-request.btn-info')).to have_content('Merge in progress')
2017-03-22 09:18:00 -04:00
wait_for_requests
end
2017-01-22 07:37:05 -05:00
end
end
end
end