gitlab-org--gitlab-foss/spec/support/matchers/have_issuable_counts.rb
Rémy Coutable 56259155d5 Small improvements thanks to Robert's feedback
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-30 12:02:54 +02:00

21 lines
562 B
Ruby

RSpec::Matchers.define :have_issuable_counts do |opts|
match do |actual|
expected_counts = opts.map do |state, count|
"#{state.to_s.humanize} #{count}"
end
actual.within '.issues-state-filters' do
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