Files
grecia/spec/support/matchers/have_avatar.rb
Javi Martín 2c9c5d9cd4 Extract component to render avatars in comments
This way it'll be easier to add tests for it and refactor it.
2024-04-11 18:48:33 +02:00

10 lines
269 B
Ruby

RSpec::Matchers.define :have_avatar do |text, **options|
match do |page|
page.has_css?("svg.initialjs-avatar", **{ exact_text: text }.merge(options))
end
failure_message do
"expected to find avatar with text #{text} but there were no matches."
end
end