Merge pull request #13777 from rioug/13481-webhook-payment

Payment status change webhook
This commit is contained in:
Filipe
2026-01-08 11:26:41 +00:00
committed by GitHub
26 changed files with 597 additions and 54 deletions

View File

@@ -39,15 +39,33 @@ 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"
within(:table_row, ["Order Cycle Opened"]) do
fill_in "order_cycle_opened_webhook_endpoint_url", with: "https://url"
click_button I18n.t(:create)
expect(page.document).to have_content I18n.t('webhook_endpoints.create.success')
expect(page).to have_content "https://url"
click_button "Create"
expect(page.document).to have_content "Webhook endpoint successfully created"
expect(page).to have_content "https://url"
click_button I18n.t(:delete)
expect(page.document).to have_content I18n.t('webhook_endpoints.destroy.success')
accept_confirm do
click_button "Delete"
end
end
expect(page.document).to have_content "Webhook endpoint successfully deleted"
expect(page).not_to have_content "https://url"
within(:table_row, ["Post webhook on Payment status change"]) do
fill_in "payment_status_changed_webhook_endpoint_url", with: "https://url/payment"
click_button "Create"
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
end
expect(page.document).to have_content "Webhook endpoint successfully deleted"
expect(page).not_to have_content "https://url/payment"
end
end
end