2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-01-31 05:05:50 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
describe 'Dashboard shortcuts', :js do
|
2017-04-07 04:46:31 -04:00
|
|
|
context 'logged in' do
|
2018-10-06 10:21:38 -04:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project) { create(:project) }
|
|
|
|
|
2017-04-07 04:46:31 -04:00
|
|
|
before do
|
2018-10-06 10:21:38 -04:00
|
|
|
project.add_developer(user)
|
|
|
|
sign_in(user)
|
2017-04-07 04:46:31 -04:00
|
|
|
visit root_dashboard_path
|
|
|
|
end
|
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
it 'Navigate to tabs' do
|
2017-05-10 11:53:11 -04:00
|
|
|
find('body').send_keys([:shift, 'I'])
|
2017-04-07 04:46:31 -04:00
|
|
|
|
|
|
|
check_page_title('Issues')
|
2017-01-31 05:05:50 -05:00
|
|
|
|
2017-05-10 11:53:11 -04:00
|
|
|
find('body').send_keys([:shift, 'M'])
|
2017-04-07 04:46:31 -04:00
|
|
|
|
|
|
|
check_page_title('Merge Requests')
|
|
|
|
|
2017-05-10 11:09:36 -04:00
|
|
|
find('body').send_keys([:shift, 'T'])
|
2017-04-07 04:46:31 -04:00
|
|
|
|
2019-07-04 11:45:54 -04:00
|
|
|
check_page_title('To-Do List')
|
2017-05-10 11:09:36 -04:00
|
|
|
|
|
|
|
find('body').send_keys([:shift, 'P'])
|
|
|
|
|
|
|
|
check_page_title('Projects')
|
2017-04-07 04:46:31 -04:00
|
|
|
end
|
|
|
|
end
|
2017-01-31 05:05:50 -05:00
|
|
|
|
2017-04-07 04:46:31 -04:00
|
|
|
context 'logged out' do
|
|
|
|
before do
|
|
|
|
visit explore_root_path
|
|
|
|
end
|
2017-01-31 05:05:50 -05:00
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
it 'Navigate to tabs' do
|
2017-05-10 11:09:36 -04:00
|
|
|
find('body').send_keys([:shift, 'G'])
|
2017-01-31 05:05:50 -05:00
|
|
|
|
2017-05-10 11:09:36 -04:00
|
|
|
find('.nothing-here-block')
|
2017-04-07 04:46:31 -04:00
|
|
|
expect(page).to have_content('No public groups')
|
2017-03-17 06:58:19 -04:00
|
|
|
|
2017-05-10 11:09:36 -04:00
|
|
|
find('body').send_keys([:shift, 'S'])
|
2017-03-17 06:58:19 -04:00
|
|
|
|
2017-05-10 11:09:36 -04:00
|
|
|
find('.nothing-here-block')
|
2019-02-22 07:12:36 -05:00
|
|
|
expect(page).to have_content('No snippets found')
|
2017-05-10 11:09:36 -04:00
|
|
|
|
|
|
|
find('body').send_keys([:shift, 'P'])
|
|
|
|
|
|
|
|
find('.nothing-here-block')
|
2019-08-02 02:43:31 -04:00
|
|
|
expect(page).to have_content('Explore public groups to find projects to contribute to.')
|
2017-04-07 04:46:31 -04:00
|
|
|
end
|
2017-01-31 05:05:50 -05:00
|
|
|
end
|
|
|
|
|
2017-02-14 18:43:03 -05:00
|
|
|
def check_page_title(title)
|
2018-10-06 10:21:38 -04:00
|
|
|
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
|