Files
osem/spec/support/flash.rb
2018-11-16 09:06:05 -08:00

17 lines
314 B
Ruby

# frozen_string_literal: true
module Flash
def flash
results = all(:css, 'div#flash p')
if results.empty?
return 'none'
end
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