osem-fcy/spec/support/flash.rb

17 lines
314 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2014-05-14 13:18:19 +02:00
module Flash
def flash
results = all(:css, 'div#flash p')
if results.empty?
return 'none'
end
2018-11-13 18:01:49 -08:00
2014-05-14 13:18:19 +02:00
if results.count > 1
texts = results.map { |r| r.text }
fail "One flash expected, but we had #{texts.inspect}"
end
results.first.text
end
end