2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-01-31 05:05:50 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-16 14:09:01 -04:00
|
|
|
RSpec.describe 'Dashboard shortcuts', :js do
|
2021-07-21 17:10:10 -04:00
|
|
|
context 'logged in' do
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project) { create(:project) }
|
2021-03-16 14:11:53 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
before do
|
|
|
|
project.add_developer(user)
|
|
|
|
sign_in(user)
|
|
|
|
visit root_dashboard_path
|
|
|
|
end
|
2018-10-06 10:21:38 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
it 'navigate to tabs' do
|
|
|
|
find('body').send_keys([:shift, 'I'])
|
2017-04-07 04:46:31 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
check_page_title('Issues')
|
2017-01-31 05:05:50 -05:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
find('body').send_keys([:shift, 'M'])
|
2017-04-07 04:46:31 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
check_page_title('Merge requests')
|
2017-04-07 04:46:31 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
find('body').send_keys([:shift, 'T'])
|
2017-04-07 04:46:31 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
check_page_title('To-Do List')
|
2017-05-10 11:09:36 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
find('body').send_keys([:shift, 'G'])
|
2020-04-14 17:09:52 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
check_page_title('Groups')
|
2020-04-14 17:09:52 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
find('body').send_keys([:shift, 'P'])
|
2017-05-10 11:09:36 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
check_page_title('Projects')
|
2020-04-09 08:09:24 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
find('body').send_keys([:shift, 'A'])
|
2020-04-09 08:09:24 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
check_page_title('Activity')
|
2021-05-31 17:09:39 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
find('body').send_keys([:shift, 'L'])
|
2021-05-31 17:09:39 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
check_page_title('Milestones')
|
2017-04-07 04:46:31 -04:00
|
|
|
end
|
2021-07-21 17:10:10 -04:00
|
|
|
end
|
2017-01-31 05:05:50 -05:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
context 'logged out' do
|
|
|
|
before do
|
|
|
|
visit explore_root_path
|
|
|
|
end
|
2021-05-12 17:10:13 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
it 'navigate to tabs' do
|
|
|
|
find('body').send_keys([:shift, 'G'])
|
2021-05-12 17:10:13 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
find('.nothing-here-block')
|
|
|
|
expect(page).to have_content('No public groups')
|
2021-05-12 17:10:13 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
find('body').send_keys([:shift, 'S'])
|
2021-05-12 17:10:13 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
find('.nothing-here-block')
|
|
|
|
expect(page).to have_content('No snippets found')
|
2021-05-12 17:10:13 -04:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
find('body').send_keys([:shift, 'P'])
|
2017-01-31 05:05:50 -05:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
find('.nothing-here-block')
|
|
|
|
expect(page).to have_content('Explore public groups to find projects to contribute to.')
|
2021-05-12 17:10:13 -04:00
|
|
|
end
|
|
|
|
end
|
2017-01-31 05:05:50 -05:00
|
|
|
|
2021-07-21 17:10:10 -04:00
|
|
|
def check_page_title(title)
|
|
|
|
expect(find('.page-title')).to have_content(title)
|
2017-01-31 05:05:50 -05:00
|
|
|
end
|
2017-05-10 11:53:11 -04:00
|
|
|
end
|