Update spec to include payment status webhook

This commit is contained in:
Gaetan Craig-Riou
2025-11-26 15:13:27 +11:00
parent ac662de789
commit 0ac4021729

View File

@@ -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