BUGFIX: we should not store absolute urls for locally uploaded avatar templates

Highly recommended to run: `RAILS_ENV=production bundle exec rake avatars:regenerate` to fix the avatar templates stored in the database.
This commit is contained in:
Régis Hanol
2014-01-07 17:45:06 +01:00
parent 0e7f2bc3a9
commit e732aa8a86
9 changed files with 29 additions and 24 deletions

View File

@ -122,10 +122,10 @@ describe FileStore::LocalStore do
store.external?.should == false
end
describe ".absolute_avatar_template" do
describe ".avatar_template" do
it "is present" do
store.absolute_avatar_template(avatar).should == "http://test.localhost/uploads/default/avatars/e9d/71f/5ee7c92d6d/{size}.jpg"
store.avatar_template(avatar).should == "/uploads/default/avatars/e9d/71f/5ee7c92d6d/{size}.jpg"
end
end

View File

@ -113,10 +113,10 @@ describe FileStore::S3Store do
store.internal?.should == false
end
describe ".absolute_avatar_template" do
describe ".avatar_template" do
it "is present" do
store.absolute_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}.jpg"
end
end