1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Assert correct response body

This commit is contained in:
George Claghorn 2018-05-03 09:03:48 -04:00
parent 4a786c0fdf
commit 8ae38dab52

View file

@ -8,16 +8,18 @@ class ActiveStorage::DiskControllerTest < ActionDispatch::IntegrationTest
blob = create_blob blob = create_blob
get blob.service_url get blob.service_url
assert_equal "inline; filename=\"hello.txt\"; filename*=UTF-8''hello.txt", @response.headers["Content-Disposition"] assert_equal "inline; filename=\"hello.txt\"; filename*=UTF-8''hello.txt", response.headers["Content-Disposition"]
assert_equal "text/plain", @response.headers["Content-Type"] assert_equal "text/plain", response.headers["Content-Type"]
assert_equal "Hello world!", response.body
end end
test "showing blob as attachment" do test "showing blob as attachment" do
blob = create_blob blob = create_blob
get blob.service_url(disposition: :attachment) get blob.service_url(disposition: :attachment)
assert_equal "attachment; filename=\"hello.txt\"; filename*=UTF-8''hello.txt", @response.headers["Content-Disposition"] assert_equal "attachment; filename=\"hello.txt\"; filename*=UTF-8''hello.txt", response.headers["Content-Disposition"]
assert_equal "text/plain", @response.headers["Content-Type"] assert_equal "text/plain", response.headers["Content-Type"]
assert_equal "Hello world!", response.body
end end