bingo: store photos in their own bucket
The bingo photos sat under bingo/ in the invoice bucket. Store them in BINGO_S3_BUCKET (datacenterbingo-photos in prod, created and pre-filled by the storage repo with the same keys) and fall back to S3_BUCKET when unset, so dev and tests need nothing new. Assisted-by: Claude:opus-5
This commit is contained in:
parent
849980042e
commit
f1ceb4efc7
5 changed files with 28 additions and 10 deletions
|
|
@ -213,6 +213,19 @@ class BingoTest < Minitest::Test
|
|||
S3.instance_variable_set(:@client, nil)
|
||||
end
|
||||
|
||||
def test_photos_use_their_own_bucket
|
||||
puts_to = []
|
||||
S3.client.stub(:put_object, ->(**o) { puts_to << o[:bucket] }) do
|
||||
ENV['BINGO_S3_BUCKET'] = 'photos-bucket'
|
||||
Bingo::Photo.store('dc-1', JPEG)
|
||||
ENV.delete('BINGO_S3_BUCKET')
|
||||
Bingo::Photo.store('dc-1', JPEG)
|
||||
end
|
||||
assert_equal ['photos-bucket', S3.bucket], puts_to
|
||||
ensure
|
||||
ENV.delete('BINGO_S3_BUCKET')
|
||||
end
|
||||
|
||||
def test_photo_rejects_non_images
|
||||
assert_raises(Bingo::Photo::Error) { Bingo::Photo.store('dc-1', '<html>') }
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue