BigW Consortium Gitlab

merge_request_helpers.rb 601 Bytes
Newer Older
1 2
module MergeRequestHelpers
  def visit_merge_requests(project, opts = {})
3
    visit project_merge_requests_path project, opts
4 5 6 7 8 9 10 11 12
  end

  def first_merge_request
    page.all('ul.mr-list > li').first.text
  end

  def last_merge_request
    page.all('ul.mr-list > li').last.text
  end
13 14 15 16 17 18 19 20 21

  def expect_mr_list_count(open_count, closed_count = 0)
    all_count = open_count + closed_count

    expect(page).to have_issuable_counts(open: open_count, closed: closed_count, all: all_count)
    page.within '.mr-list' do
      expect(page).to have_selector('.merge-request', count: open_count)
    end
  end
22
end