mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 14:44:34 +08:00
make sure we only do the work once
This commit is contained in:
@ -21,8 +21,8 @@ describe LocalStore do
|
||||
File.stubs(:open)
|
||||
# The Time needs to be frozen as it is used to generate a clean & unique name
|
||||
Time.stubs(:now).returns(Time.utc(2013, 2, 17, 12, 0, 0, 0))
|
||||
#
|
||||
LocalStore.store_file(file, image_info, 1).should == '/uploads/default/1/253dc8edf9d4ada1.png'
|
||||
#
|
||||
LocalStore.store_file(file, "", image_info, 1).should == '/uploads/default/1/253dc8edf9d4ada1.png'
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -16,7 +16,7 @@ describe S3 do
|
||||
|
||||
let(:image_info) { FastImage.new(file) }
|
||||
|
||||
before(:each) do
|
||||
before(:each) do
|
||||
SiteSetting.stubs(:s3_upload_bucket).returns("s3_upload_bucket")
|
||||
SiteSetting.stubs(:s3_access_key_id).returns("s3_access_key_id")
|
||||
SiteSetting.stubs(:s3_secret_access_key).returns("s3_secret_access_key")
|
||||
@ -24,7 +24,7 @@ describe S3 do
|
||||
end
|
||||
|
||||
it 'returns the url of the S3 upload if successful' do
|
||||
S3.store_file(file, image_info, 1).should == '//s3_upload_bucket.s3.amazonaws.com/1e8b1353813a7d091231f9a27f03566f123463fc1.png'
|
||||
S3.store_file(file, "SHA", image_info, 1).should == '//s3_upload_bucket.s3.amazonaws.com/1SHA.png'
|
||||
end
|
||||
|
||||
after(:each) do
|
||||
|
Reference in New Issue
Block a user