summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/quick_actions/issue/due_quick_action_shared_examples.rb
blob: db3ecccc339bde54515e3ff175953efa571139b8 (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
# frozen_string_literal: true

shared_examples 'due quick action not available' do
  it 'does not set the due date' do
    add_note('/due 2016-08-28')

    expect(page).not_to have_content 'Commands applied'
    expect(page).not_to have_content '/due 2016-08-28'
  end
end

shared_examples 'due quick action available and date can be added' do
  it 'sets the due date accordingly' do
    add_note('/due 2016-08-28')

    expect(page).not_to have_content '/due 2016-08-28'
    expect(page).to have_content 'Commands applied'

    visit project_issue_path(project, issue)

    page.within '.due_date' do
      expect(page).to have_content 'Aug 28, 2016'
    end
  end
end