2016-09-07 11:13:38 -04:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2017-10-03 04:35:01 -04:00
|
|
|
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
|
|
|
|
2018-01-08 04:06:25 -05:00
|
|
|
sign_in(create(: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
|
|
|
|
sign_in(create(:admin))
|
|
|
|
|
|
|
|
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
|