aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test/controllers
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-05-03 09:03:48 -0400
committerGeorge Claghorn <george@basecamp.com>2018-05-03 09:03:48 -0400
commit8ae38dab5251613a7e7f5af5289e524abca20efd (patch)
treead761ef5a14c37e5faaa70e1a89bd0ed01e7e6af /activestorage/test/controllers
parent4a786c0fdf63c9ed66a512f6026cd5fd47ed19d5 (diff)
downloadrails-8ae38dab5251613a7e7f5af5289e524abca20efd.tar.gz
rails-8ae38dab5251613a7e7f5af5289e524abca20efd.tar.bz2
rails-8ae38dab5251613a7e7f5af5289e524abca20efd.zip
Assert correct response body
Diffstat (limited to 'activestorage/test/controllers')
-rw-r--r--activestorage/test/controllers/disk_controller_test.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/activestorage/test/controllers/disk_controller_test.rb b/activestorage/test/controllers/disk_controller_test.rb
index 940dbf5918..9af7c83bdf 100644
--- a/activestorage/test/controllers/disk_controller_test.rb
+++ b/activestorage/test/controllers/disk_controller_test.rb
@@ -8,16 +8,18 @@ class ActiveStorage::DiskControllerTest < ActionDispatch::IntegrationTest
blob = create_blob
get blob.service_url
- 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 "inline; filename=\"hello.txt\"; filename*=UTF-8''hello.txt", response.headers["Content-Disposition"]
+ assert_equal "text/plain", response.headers["Content-Type"]
+ assert_equal "Hello world!", response.body
end
test "showing blob as attachment" do
blob = create_blob
get blob.service_url(disposition: :attachment)
- 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 "attachment; filename=\"hello.txt\"; filename*=UTF-8''hello.txt", response.headers["Content-Disposition"]
+ assert_equal "text/plain", response.headers["Content-Type"]
+ assert_equal "Hello world!", response.body
end