2019-07-25 01:27:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-07-23 19:28:12 -04:00
|
|
|
module MergeRequestHelpers
|
|
|
|
def visit_merge_requests(project, opts = {})
|
2017-06-29 13:06:35 -04:00
|
|
|
visit project_merge_requests_path project, opts
|
2016-07-23 19:28:12 -04:00
|
|
|
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
|
2017-02-15 17:13:53 -05:00
|
|
|
|
|
|
|
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
|
2016-07-23 19:28:12 -04:00
|
|
|
end
|