api: support the expiry param on all GET requests.

This commit is contained in:
evazion
2019-09-08 15:32:31 -05:00
parent 3f7e05316d
commit 22fd90eee9
7 changed files with 14 additions and 19 deletions

View File

@@ -192,6 +192,13 @@ class ApplicationControllerTest < ActionDispatch::IntegrationTest
assert_equal(tags.first.id, response.parsed_body.first.fetch("id"))
end
should "support the expiry parameter" do
get posts_path, as: :json, params: { expiry: "1" }
assert_response :success
assert_equal("max-age=#{1.day}, private", response.headers["Cache-Control"])
end
should "return the correct root element name for empty xml responses" do
get tags_path, as: :xml