Simplify selector finding

This commit is contained in:
John Bintz 2014-04-28 18:58:11 -04:00
parent 9579887857
commit 4aa71967a9
1 changed files with 3 additions and 7 deletions

View File

@ -21,11 +21,7 @@ def has_attribute?(name, value)
end
def find_first(search)
omatch = Capybara.match
Capybara.match = :first
result = find(search)
Capybara.match = omatch
result
find(search, match: :first)
end
def find_input(name, additional_search = '', type = '')
@ -113,8 +109,8 @@ module DontFindable
end
def dont_find(search)
dont_find_wrap(search) do
find(search)
if !has_no_selector?(search)
raise Capybara::ElementFound.new(search)
end
end
end