debian-mirror-gitlab/spec/features/boards/keyboard_shortcut_spec.rb

45 lines
985 B
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2019-12-04 20:38:33 +05:30
require 'spec_helper'
2016-09-29 09:46:39 +05:30
2020-06-23 00:09:42 +05:30
RSpec.describe 'Issue Boards shortcut', :js do
2018-03-17 18:26:18 +05:30
context 'issues are enabled' do
let(:project) { create(:project) }
2016-09-29 09:46:39 +05:30
2018-03-17 18:26:18 +05:30
before do
create(:board, project: project)
2016-09-29 09:46:39 +05:30
2021-02-22 17:27:13 +05:30
admin = create(:admin)
sign_in(admin)
gitlab_enable_admin_mode_sign_in(admin)
2016-09-29 09:46:39 +05:30
2018-03-17 18:26:18 +05:30
visit project_path(project)
end
it 'takes user to issue board index' do
find('body').native.send_keys('gb')
expect(page).to have_selector('.boards-list')
wait_for_requests
end
2016-09-29 09:46:39 +05:30
end
2018-03-17 18:26:18 +05:30
context 'issues are not enabled' do
let(:project) { create(:project, :issues_disabled) }
before do
2021-02-22 17:27:13 +05:30
admin = create(:admin)
sign_in(admin)
gitlab_enable_admin_mode_sign_in(admin)
2018-03-17 18:26:18 +05:30
visit project_path(project)
end
it 'does not take user to the issue board index' do
find('body').native.send_keys('gb')
2016-09-29 09:46:39 +05:30
2018-03-17 18:26:18 +05:30
expect(page).to have_selector("body[data-page='projects:show']")
end
2016-09-29 09:46:39 +05:30
end
end