2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 03:56:52 -04:00
|
|
|
require 'spec_helper'
|
2018-07-03 11:13:59 -04:00
|
|
|
|
2018-07-03 11:15:17 -04:00
|
|
|
describe 'Merge request > User sees revert modal', :js do
|
2018-07-03 11:13:59 -04:00
|
|
|
let(:project) { create(:project, :public, :repository) }
|
|
|
|
let(:user) { project.creator }
|
|
|
|
let(:merge_request) { create(:merge_request, source_project: project) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
2018-07-03 11:15:17 -04:00
|
|
|
visit(project_merge_request_path(project, merge_request))
|
2018-07-03 11:13:59 -04:00
|
|
|
click_button('Merge')
|
2018-07-19 03:43:27 -04:00
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
|
2018-07-03 11:13:59 -04:00
|
|
|
visit(merge_request_path(merge_request))
|
|
|
|
click_link('Revert')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows the revert modal' do
|
2019-04-03 21:08:19 -04:00
|
|
|
page.within('.modal-header') do
|
|
|
|
expect(page).to have_content 'Revert this merge request'
|
|
|
|
end
|
2018-07-03 11:13:59 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'closes the revert modal with escape keypress' do
|
|
|
|
find('#modal-revert-commit').send_keys(:escape)
|
|
|
|
|
2019-04-03 21:08:19 -04:00
|
|
|
expect(page).not_to have_selector('#modal-revert-commit', visible: true)
|
2018-07-03 11:13:59 -04:00
|
|
|
end
|
|
|
|
end
|