2017-01-31 10:05:50 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-06-29 04:13:10 +00:00
|
|
|
feature 'Dashboard shortcuts', :js do
|
2017-04-07 08:46:31 +00:00
|
|
|
context 'logged in' do
|
|
|
|
before do
|
2017-06-21 23:44:10 +00:00
|
|
|
sign_in(create(:user))
|
2017-04-07 08:46:31 +00:00
|
|
|
visit root_dashboard_path
|
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'Navigate to tabs' do
|
2017-05-10 15:53:11 +00:00
|
|
|
find('body').send_keys([:shift, 'I'])
|
2017-04-07 08:46:31 +00:00
|
|
|
|
|
|
|
check_page_title('Issues')
|
2017-01-31 10:05:50 +00:00
|
|
|
|
2017-05-10 15:53:11 +00:00
|
|
|
find('body').send_keys([:shift, 'M'])
|
2017-04-07 08:46:31 +00:00
|
|
|
|
|
|
|
check_page_title('Merge Requests')
|
|
|
|
|
2017-05-10 15:09:36 +00:00
|
|
|
find('body').send_keys([:shift, 'T'])
|
2017-04-07 08:46:31 +00:00
|
|
|
|
|
|
|
check_page_title('Todos')
|
2017-05-10 15:09:36 +00:00
|
|
|
|
|
|
|
find('body').send_keys([:shift, 'P'])
|
|
|
|
|
|
|
|
check_page_title('Projects')
|
2017-04-07 08:46:31 +00:00
|
|
|
end
|
|
|
|
end
|
2017-01-31 10:05:50 +00:00
|
|
|
|
2017-04-07 08:46:31 +00:00
|
|
|
context 'logged out' do
|
|
|
|
before do
|
|
|
|
visit explore_root_path
|
|
|
|
end
|
2017-01-31 10:05:50 +00:00
|
|
|
|
2017-04-07 08:46:31 +00:00
|
|
|
scenario 'Navigate to tabs' do
|
2017-05-10 15:09:36 +00:00
|
|
|
find('body').send_keys([:shift, 'G'])
|
2017-01-31 10:05:50 +00:00
|
|
|
|
2017-05-10 15:09:36 +00:00
|
|
|
find('.nothing-here-block')
|
2017-04-07 08:46:31 +00:00
|
|
|
expect(page).to have_content('No public groups')
|
2017-03-17 10:58:19 +00:00
|
|
|
|
2017-05-10 15:09:36 +00:00
|
|
|
find('body').send_keys([:shift, 'S'])
|
2017-03-17 10:58:19 +00:00
|
|
|
|
2017-05-10 15:09:36 +00:00
|
|
|
find('.nothing-here-block')
|
2017-04-07 08:46:31 +00:00
|
|
|
expect(page).to have_selector('.snippets-list-holder')
|
2017-05-10 15:09:36 +00:00
|
|
|
|
|
|
|
find('body').send_keys([:shift, 'P'])
|
|
|
|
|
|
|
|
find('.nothing-here-block')
|
|
|
|
expect(page).to have_content('No projects found')
|
2017-04-07 08:46:31 +00:00
|
|
|
end
|
2017-01-31 10:05:50 +00:00
|
|
|
end
|
|
|
|
|
2017-02-14 23:43:03 +00:00
|
|
|
def check_page_title(title)
|
|
|
|
expect(find('.header-content .title')).to have_content(title)
|
2017-01-31 10:05:50 +00:00
|
|
|
end
|
2017-05-10 15:53:11 +00:00
|
|
|
end
|