Skip to content

Commit 131387e

Browse files
committed
Test disabled session in blobs and representation proxy controllers
1 parent a091ea2 commit 131387e

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

activestorage/test/controllers/blobs/proxy_controller_test.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ class ActiveStorage::Blobs::ProxyControllerTest < ActionDispatch::IntegrationTes
131131
request = ActionController::TestRequest.create({})
132132
assert_instance_of ActionController::Live::Response, ActiveStorage::Blobs::ProxyController.make_response!(request)
133133
end
134+
135+
test "sessions are disabled" do
136+
get rails_storage_proxy_url(create_file_blob(filename: "racecar.jpg"))
137+
assert request.session_options[:skip],
138+
"Expected request.session_options[:skip] to be true"
139+
end
134140
end
135141

136142
class ActiveStorage::Blobs::ExpiringProxyControllerTest < ActionDispatch::IntegrationTest

activestorage/test/controllers/representations/proxy_controller_test.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,16 @@ class ActiveStorage::Representations::ProxyControllerWithVariantsTest < ActionDi
6464

6565
assert_response :not_found
6666
end
67+
68+
test "sessions are disabled" do
69+
get rails_blob_representation_proxy_url(
70+
disposition: :attachment,
71+
filename: @blob.filename,
72+
signed_blob_id: @blob.signed_id,
73+
variation_key: ActiveStorage::Variation.encode(@transformations))
74+
assert request.session_options[:skip],
75+
"Expected request.session_options[:skip] to be true"
76+
end
6777
end
6878

6979
class ActiveStorage::Representations::ProxyControllerWithVariantsWithStrictLoadingTest < ActionDispatch::IntegrationTest

0 commit comments

Comments
 (0)