mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Update spec to include payment status webhook
This commit is contained in:
@@ -39,15 +39,30 @@ RSpec.describe "Developer Settings" do
|
||||
describe "Webhook Endpoints" do
|
||||
it "creates a new webhook endpoint and deletes it" do
|
||||
within "#webhook_endpoints" do
|
||||
fill_in "webhook_endpoint_url", with: "https://url"
|
||||
fill_in "order_cycle_opened_webhook_endpoint_url", with: "https://url"
|
||||
|
||||
click_button "Create"
|
||||
expect(page.document).to have_content "Webhook endpoint successfully created"
|
||||
expect(page).to have_content "https://url"
|
||||
|
||||
click_button "Delete"
|
||||
accept_confirm do
|
||||
click_button "Delete"
|
||||
end
|
||||
expect(page.document).to have_content "Webhook endpoint successfully deleted"
|
||||
expect(page).not_to have_content "https://url"
|
||||
|
||||
within(:xpath, second_table_line) do
|
||||
fill_in "payment_status_changed_webhook_endpoint_url", with: "https://url/payment"
|
||||
click_button "Create"
|
||||
end
|
||||
expect(page.document).to have_content "Webhook endpoint successfully created"
|
||||
expect(page).to have_content "https://url/payment"
|
||||
|
||||
accept_confirm do
|
||||
click_button "Delete"
|
||||
end
|
||||
expect(page.document).to have_content "Webhook endpoint successfully deleted"
|
||||
expect(page).not_to have_content "https://urlpayment"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -64,4 +79,9 @@ RSpec.describe "Developer Settings" do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def second_table_line
|
||||
# It's actually the third line when you include the header
|
||||
'(//tr)[3]'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user