require 'test_helper'

class PdfDeliveryTest < ActionDispatch::IntegrationTest
	test "pdf request sends a pdf as file" do 
		get home_path(format: :pdf)

		assert_match "PDF", response.body
		assert_equal "binary", headers["Content-Transfer-Encoding"]

		assert_equal "attachment; filename=\"contents.pdf\"",
		  headers["Content-Disposition"]
		  assert_equal "application/pdf", headers["Content-Type"]
	end
end
require 'test_helper'

class PdfDeliveryTest < ActionDispatch::IntegrationTest
	test "pdf request sends a pdf as file" do 
		get home_path(format: :pdf)

		assert_match "PDF", response.body
		assert_equal "binary", headers["Content-Transfer-Encoding"]

		assert_equal "attachment; filename=\"contents.pdf\"",
		  headers["Content-Disposition"]
		  assert_equal "application/pdf", headers["Content-Type"]
	end
	
	test "pdf renderer uses the specific template" do 
		get another_path(format: :pdf)

		assert_match "PDF", response.body
		assert_equal "binary", headers["Content-Transfer-Encoding"]

		assert_equal "attachment; filename=\"contents.pdf\"",
		  headers["Content-Disposition"]
		  assert_equal "application/pdf", headers["Content-Type"]
	end
end
Add test to confirm the chosen template is rendered
Add test to confirm the chosen template is rendered
