2017-01-31 05:05:50 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-05-10 11:09:36 -04:00
|
|
|
feature 'Dashboard shortcuts', :feature, :js do
|
2017-04-07 04:46:31 -04:00
|
|
|
context 'logged in' do
|
|
|
|
before do
|
|
|
|
login_as :user
|
|
|
|
visit root_dashboard_path
|
|
|
|
end
|
|
|
|
|
|
|
|
scenario '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
|
|
|
|
|
|
|
check_page_title('Todos')
|
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
|
|
|
|
2017-04-07 04:46:31 -04:00
|
|
|
scenario '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')
|
2017-04-07 04:46:31 -04:00
|
|
|
expect(page).to have_selector('.snippets-list-holder')
|
2017-05-10 11:09:36 -04:00
|
|
|
|
|
|
|
find('body').send_keys([:shift, 'P'])
|
|
|
|
|
|
|
|
find('.nothing-here-block')
|
|
|
|
expect(page).to have_content('No projects found')
|
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)
|
|
|
|
expect(find('.header-content .title')).to have_content(title)
|
2017-01-31 05:05:50 -05:00
|
|
|
end
|
2017-05-10 11:53:11 -04:00
|
|
|
end
|