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

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

RSpec.shared_examples 'comment on merge request file' do
  it 'adds a comment' do
    click_diff_line(find_by_scrolling("[id='#{sample_commit.line_code}']"))

    page.within('.js-discussion-note-form') do
      fill_in(:note_note, with: 'Line is wrong')
      find('.js-comment-button').click
    end

    wait_for_requests

    page.within('.notes_holder') do
      expect(page).to have_content('Line is wrong')
      expect(page).not_to have_content('Comment on lines')
    end

    visit(merge_request_path(merge_request))

    page.within('.notes .discussion') do
      expect(page).to have_content("#{user.name} #{user.to_reference} started a thread")
      expect(page).to have_content(sample_commit.line_code_path)
      expect(page).to have_content('Line is wrong')
    end

    page.within('.notes-tab .badge') do
      expect(page).to have_content('1')
    end
  end
end