class Object
Public Instance Methods
apply_filter(options, filter)
click to toggle source
# File lib/decidim/admin/test/filterable_examples.rb, line 10 def apply_filter(options, filter) within(".filters__section") do find_link("Filter").hover find_link(options).hover click_link(filter, href: /q/) end end
filterable_method(method_name)
click to toggle source
# File lib/decidim/admin/test/filterable_examples.rb, line 6 def filterable_method(method_name) resource_controller.new.send(method_name) end
remove_applied_filter(filter)
click to toggle source
# File lib/decidim/admin/test/filterable_examples.rb, line 18 def remove_applied_filter(filter) within(".label", text: /#{filter}/i) do click_link("Cancel") end end
search_by_text(text)
click to toggle source
# File lib/decidim/admin/test/filterable_examples.rb, line 24 def search_by_text(text) within(".filters__section") do fill_in("q[#{filterable_method(:search_field_predicate)}]", with: text) find("*[type=submit]").click end end