summaryrefslogtreecommitdiff
path: root/features/steps/shared/note.rb
blob: bf1b88c60d78fe55ae94e5c25175c99c82981eb2 (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
module SharedNote
  include Spinach::DSL
  include WaitForRequests

  after do
    wait_for_requests if javascript_test?
  end

  step 'I haven\'t written any comment text' do
    page.within(".js-main-target-form") do
      fill_in "note[note]", with: ""
    end
  end

  step 'The comment preview tab should say there is nothing to do' do
    page.within(".js-main-target-form") do
      find('.js-md-preview-button').click
      expect(find('.js-md-preview')).to have_content('Nothing to preview.')
    end
  end

  step 'I should see no notes at all' do
    expect(page).not_to have_css('.note')
  end
end