From fd23f5024377ee3d31d1a9fd7d2f094036ceb45b Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 20 Jun 2023 18:15:35 +0200 Subject: [PATCH] Fix wrong view being displayed when a webhook fails validation (#25464) --- app/controllers/admin/webhooks_controller.rb | 2 +- spec/controllers/admin/webhooks_controller_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/webhooks_controller.rb b/app/controllers/admin/webhooks_controller.rb index 01d9ba8ce2a..e0874766589 100644 --- a/app/controllers/admin/webhooks_controller.rb +++ b/app/controllers/admin/webhooks_controller.rb @@ -42,7 +42,7 @@ module Admin if @webhook.update(resource_params) redirect_to admin_webhook_path(@webhook) else - render :show + render :edit end end diff --git a/spec/controllers/admin/webhooks_controller_spec.rb b/spec/controllers/admin/webhooks_controller_spec.rb index 5e45c740823..074956c5556 100644 --- a/spec/controllers/admin/webhooks_controller_spec.rb +++ b/spec/controllers/admin/webhooks_controller_spec.rb @@ -82,7 +82,7 @@ describe Admin::WebhooksController do end.to_not change(webhook, :url) expect(response).to have_http_status(:success) - expect(response).to render_template(:show) + expect(response).to render_template(:edit) end end