6. Add webhook endpoints to user developer settings screen

Allowing creation and deleting via the user association.
It probably won't be much effort to allow editing and multiple records, but I cut it down to the minimum needed to avoid any further delays.

I couldn't find a way to test a failure in the destroy method, but decided to keep the condition because I thought it was worth having.
This commit is contained in:
David Cook
2022-11-04 16:32:32 +11:00
parent 3d81a6e280
commit 00a823b2fc
9 changed files with 190 additions and 2 deletions

View File

@@ -35,6 +35,22 @@ describe "Developer Settings" do
expect(page).to have_content "Key generated"
expect(page).to have_input "api_key", with: user.reload.spree_api_key
end
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"
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 I18n.t(:delete)
expect(page.document).to have_content I18n.t('webhook_endpoints.destroy.success')
expect(page).to_not have_content "https://url"
end
end
end
end
end