Sha256: f3980edf59a82f43a81ef508114590432b92e0f25b0557e38ceb8a1e9bb8d4ac
Contents?: true
Size: 1.26 KB
Versions: 22
Compression:
Stored size: 1.26 KB
Contents
require "test_helper" describe S3Relay::UploadPresigner do before do S3Relay::UploadPresigner.any_instance.stubs(:access_key_id) .returns("access-key-id") S3Relay::UploadPresigner.any_instance.stubs(:secret_access_key) .returns("secret-access-key") S3Relay::UploadPresigner.any_instance.stubs(:region) .returns("region") S3Relay::UploadPresigner.any_instance.stubs(:bucket) .returns("bucket") S3Relay::UploadPresigner.any_instance.stubs(:acl) .returns("acl") end describe "#form_data" do it do uuid = SecureRandom.uuid time = Time.parse("2014-12-01 12:00am") S3Relay::UploadPresigner.any_instance.stubs(:uuid).returns(uuid) data = S3Relay::UploadPresigner.new(expires: time).form_data data["awsaccesskeyid"].must_equal "access-key-id" data["x_amz_server_side_encryption"].must_equal "AES256" data["key"].must_equal "#{uuid}/${filename}" data["success_action_status"].must_equal "201" data["acl"].must_equal "acl" data["endpoint"].must_equal "https://bucket.s3-region.amazonaws.com" data["policy"].length.must_equal 400 # TODO: Improve this data["signature"].length.must_equal 28 # TODO: Improve this data["uuid"].must_equal uuid end end end
Version data entries
22 entries across 22 versions & 3 rubygems