Files
nairobi/spec/support/matchers/be_rendered.rb
taitus 612872ac7a Define and apply matcher :be_rendered
Add this changes to make components specs clear
2021-11-04 10:49:36 +01:00

14 lines
389 B
Ruby

RSpec::Matchers.define :be_rendered do
match do |page|
!page.native.inner_html.empty?
end
failure_message_when_negated do |page|
if page.has_css?("body")
"expected page not to be rendered, but was rendered with #{page.find("body").native.inner_html}"
else
"expected page not to be rendered, but was rendered with #{page.native.inner_html}"
end
end
end