Merge branch 'master' of github.com:johnbintz/semantic_rails_view_helpers
This commit is contained in:
commit
d6c5879bea
|
@ -77,6 +77,10 @@ end
|
||||||
def dont_find_wrap(search)
|
def dont_find_wrap(search)
|
||||||
yield
|
yield
|
||||||
|
|
||||||
|
sleep Capybara.default_wait_time
|
||||||
|
|
||||||
|
yield
|
||||||
|
|
||||||
raise Capybara::ElementFound.new(search)
|
raise Capybara::ElementFound.new(search)
|
||||||
rescue Capybara::ElementNotFound
|
rescue Capybara::ElementNotFound
|
||||||
true
|
true
|
||||||
|
@ -106,11 +110,17 @@ def within_object(object, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
def object_matcher(object)
|
def object_matcher(object)
|
||||||
"[data-id='#{object.id}'][data-type='#{object.class}']"
|
if object.respond_to?(:id)
|
||||||
|
match = "[data-type='#{object.class}'][data-id='#{object.id}']"
|
||||||
|
elsif object.kind_of?(::Class)
|
||||||
|
match = "[data-type='#{object}']"
|
||||||
|
end
|
||||||
|
|
||||||
|
match
|
||||||
end
|
end
|
||||||
|
|
||||||
def within_object_of_type(klass, &block)
|
def within_object_of_type(klass, &block)
|
||||||
within("[data-type='#{klass}']", &block)
|
within_object(klass, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
def within_any(search, &block)
|
def within_any(search, &block)
|
||||||
|
|
Loading…
Reference in New Issue