diff options
author | George Tsiolis <tsiolis.g@gmail.com> | 2018-07-05 10:43:16 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-07-05 10:43:16 +0300 |
commit | 6af7397f600b004d47acab2eb797903da5cf302d (patch) | |
tree | bc1ee6831f8fe7b05008f5b0a2d958f518fb30c5 /spec/features/projects | |
parent | a43b7d4a33491a040432229ab91742d3a5981c0a (diff) |
Close revoke deploy token modal on escape keypress
Diffstat (limited to 'spec/features/projects')
-rw-r--r-- | spec/features/projects/settings/user_sees_revoke_deploy_token_modal_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/features/projects/settings/user_sees_revoke_deploy_token_modal_spec.rb b/spec/features/projects/settings/user_sees_revoke_deploy_token_modal_spec.rb new file mode 100644 index 00000000000..069704a1305 --- /dev/null +++ b/spec/features/projects/settings/user_sees_revoke_deploy_token_modal_spec.rb @@ -0,0 +1,25 @@ +require 'rails_helper' + +describe 'Repository Settings > User sees revoke deploy token modal', :js do + let(:project) { create(:project, :public, :repository) } + let(:user) { project.creator } + let(:role) { :developer } + let!(:deploy_token) { create(:deploy_token, :gitlab_deploy_token, projects: [project]) } + + before do + project.add_role(user, role) + sign_in(user) + visit(project_settings_repository_path(project)) + click_link('Revoke') + end + + it 'shows the revoke deploy token modal' do + expect(page).to have_content('You are about to revoke') + end + + it 'closes the revoke deploy token modal with escape keypress' do + find('.modal.show').send_keys(:escape) + + expect(page).not_to have_content('You are about to revoke') + end +end |