Welcome to mirror list, hosted at ThFree Co, Russian Federation.

keyboard_shortcut_spec.rb « issues « features « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e1325e63e6b6764b23ff9d3a3b01ffc491703326 (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
30
31
32
33
34
35
36
37
38
# frozen_string_literal: true

require 'rails_helper'

describe 'Issues shortcut', :js do
  context 'New Issue shortcut' do
    context 'issues are enabled' do
      let(:project) { create(:project) }

      before do
        sign_in(create(:admin))

        visit project_path(project)
      end

      it 'takes user to the new issue page' do
        find('body').native.send_keys('i')
        expect(page).to have_selector('#new_issue')
      end
    end

    context 'issues are not enabled' do
      let(:project) { create(:project, :issues_disabled) }

      before do
        sign_in(create(:admin))

        visit project_path(project)
      end

      it 'does not take user to the new issue page' do
        find('body').native.send_keys('i')

        expect(page).to have_selector("body[data-page='projects:show']")
      end
    end
  end
end