summaryrefslogtreecommitdiff
path: root/spec/features/dashboard/shortcuts_spec.rb
blob: d9be4e5dbdd3af3188c635479d1da43ad10032a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require 'spec_helper'

feature 'Dashboard shortcuts', feature: true, js: true do
  before do
    login_as :user
    visit dashboard_projects_path
  end

  scenario 'Navigate to tabs' do
    find('body').native.send_key('g')
    find('body').native.send_key('p')

    ensure_active_main_tab('Projects')

    find('body').native.send_key('g')
    find('body').native.send_key('i')

    ensure_active_main_tab('Issues')

    find('body').native.send_key('g')
    find('body').native.send_key('m')

    ensure_active_main_tab('Merge Requests')
  end

  def ensure_active_main_tab(content)
    expect(find('.nav-sidebar li.active')).to have_content(content)
  end
end