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
|
2018-12-13 13:39:08 +05:30
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project) { create(:project) }
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
before do
|
2018-12-13 13:39:08 +05:30
|
|
|
project.add_developer(user)
|
|
|
|
sign_in(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')
|
2019-03-02 22:35:43 +05:30
|
|
|
expect(page).to have_content('This user doesn\'t have any personal projects')
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def check_page_title(title)
|
2018-12-13 13:39:08 +05:30
|
|
|
expect(find('.page-title')).to have_content(title)
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
end
|