From beaef4b6723cc0ddd34a3139749e02e870178c2b Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 26 Jan 2024 11:23:12 -0500 Subject: [PATCH] Combine double subjects in application controller shared example (#28938) --- spec/controllers/application_controller_spec.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index e9d4796035..a309e933ee 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -22,13 +22,10 @@ describe ApplicationController do end shared_examples 'respond_with_error' do |code| - it "returns http #{code} for http" do - subject - expect(response).to have_http_status(code) - end - - it 'renders template for http' do + it "returns http #{code} for http and renders template" do expect(subject).to render_template("errors/#{code}", layout: 'error') + + expect(response).to have_http_status(code) end end