gitlab-org--gitlab-foss/spec/support/helpers/merge_request_helpers.rb
Rémy Coutable 023d4f6f2f
Move spec helpers/matchers/shared examples/contexts to their relevant folder
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-04-23 12:20:30 +02:00

22 lines
601 B
Ruby

module MergeRequestHelpers
def visit_merge_requests(project, opts = {})
visit project_merge_requests_path project, opts
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
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
end