Skip to content

Commit

Permalink
WIP - request tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leenagupte committed Sep 13, 2024
1 parent 9fe6a4c commit 1776bff
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions spec/requests/travel_advice_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,57 @@
end
end
end

context "GET show" do
context "first part" do
before do
@content_item = GovukSchemas::Example.find("travel_advice", example_name: "full-country")
@country_path = @content_item.fetch("base_path")
stub_content_store_has_item(@country_path, @content_item)
end

it "succeeds" do
# require "pry"; binding.pry
get @country_path

expect(response).to have_http_status(:ok)
end

it "renders the show template" do
get @country_path

expect(response).to render_template(:show)
end

it "renders the print variant" do
get "#{@country_path}/print"

expect(response).to render_template(:show)
end

it "sets cache-control headers" do
get @country_path
honours_content_store_ttl
end
end

# context("first part") do
# it "succeeds" do
# get @base_path

# expect(response).to have_http_status(:ok)
# end

# it "renders the show template" do
# get @base_path

# expect(response).to render_template(:show)
# end

# it "sets cache-control headers" do
# get @base_path
# honours_content_store_ttl
# end
# end
end
end

0 comments on commit 1776bff

Please sign in to comment.