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

remove_due_date_quick_action_shared_examples.rb « issue « quick_actions « shared_examples « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dd1676a08e269c92b5d7048ec553f1450f24d78a (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
# frozen_string_literal: true

shared_examples 'remove_due_date quick action' do
  context 'remove_due_date action available and due date can be removed' do
    it 'removes the due date accordingly' do
      add_note('/remove_due_date')

      expect(page).not_to have_content '/remove_due_date'
      expect(page).to have_content 'Commands applied'

      visit project_issue_path(project, issue)

      page.within '.due_date' do
        expect(page).to have_content 'No due date'
      end
    end
  end

  context 'remove_due_date action not available' do
    let(:guest) { create(:user) }
    before do
      project.add_guest(guest)
      gitlab_sign_out
      sign_in(guest)
      visit project_issue_path(project, issue)
    end

    it 'does not remove the due date' do
      add_note("/remove_due_date")

      expect(page).not_to have_content 'Commands applied'
      expect(page).not_to have_content '/remove_due_date'
    end
  end
end