Commit f0f65047 authored by George Tsiolis's avatar George Tsiolis

Add spec for closing revert modal on escape keypress

parent 734a9d80
require 'rails_helper'
describe 'Merge request > User sees Revert modal', :js do
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')
visit(merge_request_path(merge_request))
click_link('Revert')
end
it 'shows the revert modal' do
expect(page).to have_content('Revert this merge request')
end
it 'closes the revert modal with escape keypress' do
find('#modal-revert-commit').send_keys(:escape)
expect(page).not_to have_content('Revert this merge request')
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment