From f73d0752cece23641e5edbb31aea99f3c1670342 Mon Sep 17 00:00:00 2001 From: Leena Gupte Date: Fri, 20 Dec 2024 12:38:46 +0000 Subject: [PATCH] Fix failing transaction request tests These tests relied on a publication instance being created, whereas now the publication method just returns the content item instance. --- spec/requests/transactions_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/requests/transactions_spec.rb b/spec/requests/transactions_spec.rb index 9a1d33b344..1651a9f6f5 100644 --- a/spec/requests/transactions_spec.rb +++ b/spec/requests/transactions_spec.rb @@ -34,7 +34,7 @@ it "loads the correct details" do get "/jobsearch" - expect(assigns(:publication).title).to eq(@content_item["title"]) + expect(assigns(:content_item).title).to eq(@content_item["title"]) end it "sets correct expiry headers" do @@ -65,14 +65,14 @@ it "displays variant specific values where present" do get "/foo", params: { variant: "council-tax-bands-2-staging" } - expect(assigns(:publication).title).to eq(@content_item.dig("details", "variants", 0, "title")) - expect(assigns(:publication).transaction_start_link).to eq(@content_item.dig("details", "variants", 0, "transaction_start_link")) + expect(assigns(:content_item).title).to eq(@content_item.dig("details", "variants", 0, "title")) + expect(assigns(:content_item).transaction_start_link).to eq(@content_item.dig("details", "variants", 0, "transaction_start_link")) end it "displays normal value where variant does not specify value" do get "/foo", params: { variant: "council-tax-bands-2-staging" } - expect(assigns(:publication).more_information).to eq(@content_item.dig("details", "more_information")) + expect(assigns(:content_item).more_information).to eq(@content_item.dig("details", "more_information")) end end end