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

70 lines
1.5 KiB
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
require 'spec_helper'
2020-06-23 00:09:42 +05:30
RSpec.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
2019-09-30 21:07:59 +05:30
check_page_title('To-Do List')
2017-09-10 17:25:29 +05:30
2020-04-22 19:07:51 +05:30
find('body').send_keys([:shift, 'G'])
check_page_title('Groups')
2017-09-10 17:25:29 +05:30
find('body').send_keys([:shift, 'P'])
check_page_title('Projects')
2020-04-22 19:07:51 +05:30
find('body').send_keys([:shift, 'A'])
check_page_title('Activity')
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')
2019-07-07 11:18:12 +05:30
expect(page).to have_content('No snippets found')
2017-09-10 17:25:29 +05:30
find('body').send_keys([:shift, 'P'])
find('.nothing-here-block')
2020-03-13 15:44:24 +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