summaryrefslogtreecommitdiff
path: root/spec/features/issues
diff options
context:
space:
mode:
authorChristiaan Van den Poel <christiaan.vandenpoel@gmail.com>2018-01-08 09:06:25 +0000
committerPhil Hughes <me@iamphill.com>2018-01-08 09:06:25 +0000
commit66ebb206b09f83288ee6acbd6d11b2963ae43c9b (patch)
tree7447b9e0647bebbe0eb5a59af0f068a35ce11e25 /spec/features/issues
parent15f7f52b4034d4ede3b923e95df6884f36194245 (diff)
downloadgitlab-ce-66ebb206b09f83288ee6acbd6d11b2963ae43c9b.tar.gz
disables the shortcut to the issue boards when issues are disabled
Diffstat (limited to 'spec/features/issues')
-rw-r--r--spec/features/issues/keyboard_shortcut_spec.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/features/issues/keyboard_shortcut_spec.rb b/spec/features/issues/keyboard_shortcut_spec.rb
new file mode 100644
index 00000000000..961de9d3d25
--- /dev/null
+++ b/spec/features/issues/keyboard_shortcut_spec.rb
@@ -0,0 +1,36 @@
+require 'rails_helper'
+
+describe 'Issues shortcut', :js do
+ context 'New Issue shortcut' do
+ context 'issues are enabled' do
+ let(:project) { create(:project) }
+
+ before do
+ sign_in(create(:admin))
+
+ visit project_path(project)
+ end
+
+ it 'takes user to the new issue page' do
+ find('body').native.send_keys('i')
+ expect(page).to have_selector('#new_issue')
+ end
+ end
+
+ context 'issues are not enabled' do
+ let(:project) { create(:project, :issues_disabled) }
+
+ before do
+ sign_in(create(:admin))
+
+ visit project_path(project)
+ end
+
+ it 'does not take user to the new issue page' do
+ find('body').native.send_keys('i')
+
+ expect(page).to have_selector("body[data-page='projects:show']")
+ end
+ end
+ end
+end