diff --git a/spec/system/consumer/account/developer_settings_spec.rb b/spec/system/consumer/account/developer_settings_spec.rb index d1382fdde0..dd0a264844 100644 --- a/spec/system/consumer/account/developer_settings_spec.rb +++ b/spec/system/consumer/account/developer_settings_spec.rb @@ -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