osem-fcy/spec/support/flash.rb
2015-10-22 15:23:11 +02:00

13 lines
275 B
Ruby

module Flash
def flash
results = all(:css, 'div#flash p')
if results.empty?
return 'none'
end
if results.count > 1
texts = results.map(&:text)
fail "One flash expected, but we had #{texts.inspect}"
end
results.first.text
end
end