2014-05-14 13:18:19 +02:00
|
|
|
module Flash
|
|
|
|
|
def flash
|
|
|
|
|
results = all(:css, 'div#flash p')
|
|
|
|
|
if results.empty?
|
|
|
|
|
return 'none'
|
|
|
|
|
end
|
|
|
|
|
if results.count > 1
|
2015-10-21 17:33:53 +02:00
|
|
|
texts = results.map(&:text)
|
2014-05-14 13:18:19 +02:00
|
|
|
fail "One flash expected, but we had #{texts.inspect}"
|
|
|
|
|
end
|
|
|
|
|
results.first.text
|
|
|
|
|
end
|
|
|
|
|
end
|