From 1f7b44de674f7af8277fe5fcdce686a62e254b8a Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Tue, 4 Aug 2020 16:29:41 +1000 Subject: [PATCH] DEV: Remove flaky secure optimized image spec --- spec/models/optimized_image_spec.rb | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/spec/models/optimized_image_spec.rb b/spec/models/optimized_image_spec.rb index d98162822d7..a922e822284 100644 --- a/spec/models/optimized_image_spec.rb +++ b/spec/models/optimized_image_spec.rb @@ -343,26 +343,6 @@ describe OptimizedImage do expect(oi.filesize).to be > 0 end end - - context "secure uploads enabled" do - it "allows to recalculate the filesize" do - SiteSetting.secure_media = true - s3_upload = Fabricate(:secure_upload_s3) - - stub_request(:head, "https://#{SiteSetting.s3_upload_bucket}.s3.amazonaws.com/") - stub_request(:get, Discourse.store.signed_url_for_path(s3_upload.url)).to_return(status: 200, body: file_from_fixtures("logo.png")) - stub_request(:put, "https://#{SiteSetting.s3_upload_bucket}.s3.amazonaws.com/optimized/1X/#{s3_upload.sha1}_2_100x200.png") - .to_return(status: 200, headers: { "ETag" => "someetag" }) - - oi = OptimizedImage.create_for(s3_upload, 100, 200) - oi.filesize = nil - - stub_request(:get, Discourse.store.signed_url_for_path(oi.url)) - .to_return(status: 200, body: file_from_fixtures("resized.png")) - - expect(oi.filesize).to be > 0 - end - end end end end