2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
require 'spec_helper'
|
2018-11-18 11:00:15 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
RSpec.describe 'Merge request > User sees revert modal', :js, :sidekiq_might_not_need_inline do
|
2018-11-18 11:00:15 +05:30
|
|
|
let(:project) { create(:project, :public, :repository) }
|
|
|
|
let(:user) { project.creator }
|
|
|
|
let(:merge_request) { create(:merge_request, source_project: project) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
|
|
|
visit(project_merge_request_path(project, merge_request))
|
|
|
|
click_button('Merge')
|
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
|
|
|
|
visit(merge_request_path(merge_request))
|
|
|
|
click_link('Revert')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows the revert modal' do
|
2019-07-07 11:18:12 +05:30
|
|
|
page.within('.modal-header') do
|
|
|
|
expect(page).to have_content 'Revert this merge request'
|
|
|
|
end
|
2018-11-18 11:00:15 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it 'closes the revert modal with escape keypress' do
|
|
|
|
find('#modal-revert-commit').send_keys(:escape)
|
|
|
|
|
2019-07-07 11:18:12 +05:30
|
|
|
expect(page).not_to have_selector('#modal-revert-commit', visible: true)
|
2018-11-18 11:00:15 +05:30
|
|
|
end
|
|
|
|
end
|