2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 03:56:52 -04:00
|
|
|
require 'spec_helper'
|
2018-01-08 04:06:25 -05:00
|
|
|
|
2020-06-16 14:09:01 -04:00
|
|
|
RSpec.describe 'Issues shortcut', :js do
|
2018-01-08 04:06:25 -05:00
|
|
|
context 'New Issue shortcut' do
|
|
|
|
context 'issues are enabled' do
|
|
|
|
let(:project) { create(:project) }
|
|
|
|
|
|
|
|
before do
|
2022-01-24 19:11:49 -05:00
|
|
|
sign_in(project.first_owner)
|
2018-01-08 04:06:25 -05:00
|
|
|
|
|
|
|
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
|
2022-01-24 19:11:49 -05:00
|
|
|
sign_in(project.first_owner)
|
2018-01-08 04:06:25 -05:00
|
|
|
|
|
|
|
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
|