Replace flash helper with "within"
So we can't forget to find "#flash" on the page ever again...
This commit is contained in:
parent
bc1a21ae46
commit
df0b9ab356
29 changed files with 116 additions and 180 deletions
|
|
@ -1,16 +0,0 @@
|
|||
# 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue