osem-fcy/spec/support/flash.rb

14 lines
293 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')
return 'none' if results.empty?
2014-05-14 13:18:19 +02:00
if results.count > 1
texts = results.map(&:text)
raise "One flash expected, but we had #{texts.inspect}"
2014-05-14 13:18:19 +02:00
end
results.first.text
end
end