2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 03:56:52 -04:00
|
|
|
require 'spec_helper'
|
2016-09-07 11:13:38 -04:00
|
|
|
|
2020-06-16 14:09:01 -04:00
|
|
|
RSpec.describe 'Issue Boards shortcut', :js do
|
2018-01-08 04:06:25 -05:00
|
|
|
context 'issues are enabled' do
|
|
|
|
let(:project) { create(:project) }
|
2016-09-07 11:13:38 -04:00
|
|
|
|
2018-01-08 04:06:25 -05:00
|
|
|
before do
|
|
|
|
create(:board, project: project)
|
2016-09-07 11:13:38 -04:00
|
|
|
|
2020-11-23 10:09:37 -05:00
|
|
|
admin = create(:admin)
|
|
|
|
sign_in(admin)
|
|
|
|
gitlab_enable_admin_mode_sign_in(admin)
|
2016-09-07 11:13:38 -04:00
|
|
|
|
2018-01-08 04:06:25 -05:00
|
|
|
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-07 11:13:38 -04:00
|
|
|
end
|
|
|
|
|
2018-01-08 04:06:25 -05:00
|
|
|
context 'issues are not enabled' do
|
|
|
|
let(:project) { create(:project, :issues_disabled) }
|
|
|
|
|
|
|
|
before do
|
2020-11-23 10:09:37 -05:00
|
|
|
admin = create(:admin)
|
|
|
|
sign_in(admin)
|
|
|
|
gitlab_enable_admin_mode_sign_in(admin)
|
2018-01-08 04:06:25 -05:00
|
|
|
|
|
|
|
visit project_path(project)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not take user to the issue board index' do
|
|
|
|
find('body').native.send_keys('gb')
|
2016-09-07 12:14:41 -04:00
|
|
|
|
2018-01-08 04:06:25 -05:00
|
|
|
expect(page).to have_selector("body[data-page='projects:show']")
|
|
|
|
end
|
2016-09-07 11:13:38 -04:00
|
|
|
end
|
|
|
|
end
|