mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 01:05:11 +08:00
FEATURE: support email attachments
This commit is contained in:
@ -6,12 +6,7 @@ describe FileStore::LocalStore do
|
||||
let(:store) { FileStore::LocalStore.new }
|
||||
|
||||
let(:upload) { build(:upload) }
|
||||
let(:uploaded_file) do
|
||||
ActionDispatch::Http::UploadedFile.new({
|
||||
filename: 'logo.png',
|
||||
tempfile: File.new("#{Rails.root}/spec/fixtures/images/logo.png")
|
||||
})
|
||||
end
|
||||
let(:uploaded_file) { File.new("#{Rails.root}/spec/fixtures/images/logo.png") }
|
||||
|
||||
let(:optimized_image) { build(:optimized_image) }
|
||||
let(:avatar) { build(:upload) }
|
||||
@ -40,7 +35,7 @@ describe FileStore::LocalStore do
|
||||
|
||||
it "returns a relative url" do
|
||||
store.expects(:copy_file)
|
||||
store.store_avatar({}, upload, 100).should == "/uploads/default/avatars/e9d/71f/5ee7c92d6d/100.jpg"
|
||||
store.store_avatar({}, upload, 100).should == "/uploads/default/avatars/e9d/71f/5ee7c92d6d/100.png"
|
||||
end
|
||||
|
||||
end
|
||||
@ -125,7 +120,7 @@ describe FileStore::LocalStore do
|
||||
describe ".avatar_template" do
|
||||
|
||||
it "is present" do
|
||||
store.avatar_template(avatar).should == "/uploads/default/avatars/e9d/71f/5ee7c92d6d/{size}.jpg"
|
||||
store.avatar_template(avatar).should == "/uploads/default/avatars/e9d/71f/5ee7c92d6d/{size}.png"
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -64,7 +64,7 @@ describe FileStore::S3Store do
|
||||
|
||||
it "returns an absolute schemaless url" do
|
||||
avatar.stubs(:id).returns(42)
|
||||
store.store_avatar(avatar_file, avatar, 100).should == "//s3_upload_bucket.s3.amazonaws.com/avatars/e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98/100.jpg"
|
||||
store.store_avatar(avatar_file, avatar, 100).should == "//s3_upload_bucket.s3.amazonaws.com/avatars/e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98/100.png"
|
||||
end
|
||||
|
||||
end
|
||||
@ -116,7 +116,7 @@ describe FileStore::S3Store do
|
||||
describe ".avatar_template" do
|
||||
|
||||
it "is present" do
|
||||
store.avatar_template(avatar).should == "//s3_upload_bucket.s3.amazonaws.com/avatars/e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98/{size}.jpg"
|
||||
store.avatar_template(avatar).should == "//s3_upload_bucket.s3.amazonaws.com/avatars/e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98/{size}.png"
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user