Skip to content

Commit

Permalink
Fix failing transaction request tests
Browse files Browse the repository at this point in the history
These tests relied on a publication instance being created, whereas now
the publication method just returns the content item instance.
  • Loading branch information
leenagupte committed Dec 20, 2024
1 parent 1124057 commit f73d075
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/requests/transactions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit f73d075

Please sign in to comment.