debian-mirror-gitlab/spec/features/dashboard/shortcuts_spec.rb

56 lines
1.2 KiB
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
require 'spec_helper'
2018-11-08 19:23:39 +05:30
describe 'Dashboard shortcuts', :js do
2017-08-17 22:00:37 +05:30
context 'logged in' do
before do
2017-09-10 17:25:29 +05:30
sign_in(create(:user))
2017-08-17 22:00:37 +05:30
visit root_dashboard_path
end
2018-11-08 19:23:39 +05:30
it 'Navigate to tabs' do
2017-09-10 17:25:29 +05:30
find('body').send_keys([:shift, 'I'])
2017-08-17 22:00:37 +05:30
check_page_title('Issues')
2017-09-10 17:25:29 +05:30
find('body').send_keys([:shift, 'M'])
2017-08-17 22:00:37 +05:30
check_page_title('Merge Requests')
2017-09-10 17:25:29 +05:30
find('body').send_keys([:shift, 'T'])
2017-08-17 22:00:37 +05:30
check_page_title('Todos')
2017-09-10 17:25:29 +05:30
find('body').send_keys([:shift, 'P'])
check_page_title('Projects')
2017-08-17 22:00:37 +05:30
end
end
context 'logged out' do
before do
visit explore_root_path
end
2018-11-08 19:23:39 +05:30
it 'Navigate to tabs' do
2017-09-10 17:25:29 +05:30
find('body').send_keys([:shift, 'G'])
2017-08-17 22:00:37 +05:30
2017-09-10 17:25:29 +05:30
find('.nothing-here-block')
2017-08-17 22:00:37 +05:30
expect(page).to have_content('No public groups')
2017-09-10 17:25:29 +05:30
find('body').send_keys([:shift, 'S'])
2017-08-17 22:00:37 +05:30
2017-09-10 17:25:29 +05:30
find('.nothing-here-block')
2017-08-17 22:00:37 +05:30
expect(page).to have_selector('.snippets-list-holder')
2017-09-10 17:25:29 +05:30
find('body').send_keys([:shift, 'P'])
find('.nothing-here-block')
expect(page).to have_content('No projects found')
2017-08-17 22:00:37 +05:30
end
end
def check_page_title(title)
2018-03-17 18:26:18 +05:30
expect(find('.breadcrumbs-sub-title')).to have_content(title)
2017-08-17 22:00:37 +05:30
end
end