mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-04 22:16:08 +00:00
Add web helper method to visit paths with delete method
This commit is contained in:
@@ -76,6 +76,11 @@ module WebHelper
|
||||
page.find(:xpath, "//div[@class=\"ui-dialog-buttonset\"]//span[contains(text(),\"#{button_content}\")]").click
|
||||
end
|
||||
|
||||
def visit_delete(url)
|
||||
response = Capybara.current_session.driver.delete url
|
||||
click_link 'redirected' if response.status == 302
|
||||
end
|
||||
|
||||
def trigger_manual_event(field_selector, event = 'change')
|
||||
page.execute_script("$('#{field_selector}').trigger('#{event}');")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user