debian-mirror-gitlab/spec/support/matchers/have_issuable_counts.rb

24 lines
575 B
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2016-11-03 12:29:30 +05:30
RSpec::Matchers.define :have_issuable_counts do |opts|
2017-08-17 22:00:37 +05:30
expected_counts = opts.map do |state, count|
"#{state.to_s.humanize} #{count}"
end
2016-11-03 12:29:30 +05:30
2017-08-17 22:00:37 +05:30
match do |actual|
2021-09-30 23:02:18 +05:30
actual.within '.top-area' do
2016-11-03 12:29:30 +05:30
expected_counts.each do |expected_count|
expect(actual).to have_content(expected_count)
end
end
end
description do
"displays the following issuable counts: #{expected_counts.inspect}"
end
failure_message do
"expected the following issuable counts: #{expected_counts.inspect} to be displayed"
end
end