missed one spot where route changed

This commit is contained in:
Sam 2014-05-28 01:08:45 +10:00
parent 663c57a0f0
commit 1e28668e9f
2 changed files with 4 additions and 4 deletions

View File

@ -354,7 +354,7 @@ class User < ActiveRecord::Base
def self.avatar_template(username,uploaded_avatar_id)
id = uploaded_avatar_id || -1
username ||= ""
"/user_avatar/#{username.downcase}/{size}/#{id}.png"
"/user_avatar/#{RailsMultisite::ConnectionManagement.current_hostname}/#{username.downcase}/{size}/#{id}.png"
end
def avatar_template

View File

@ -978,7 +978,7 @@ describe User do
let(:user) { build(:user, username: 'Sam') }
it "returns a 45-pixel-wide avatar" do
user.small_avatar_url.should == "//test.localhost/user_avatar/sam/45/-1.png"
user.small_avatar_url.should == "//test.localhost/user_avatar/test.localhost/sam/45/-1.png"
end
end
@ -988,12 +988,12 @@ describe User do
let(:user) { build(:user, uploaded_avatar_id: 99, username: 'Sam') }
it "returns a schemaless avatar template with correct id" do
user.avatar_template_url.should == "//test.localhost/user_avatar/sam/{size}/99.png"
user.avatar_template_url.should == "//test.localhost/user_avatar/test.localhost/sam/{size}/99.png"
end
it "returns a schemaless cdn-based avatar template" do
Rails.configuration.action_controller.stubs(:asset_host).returns("http://my.cdn.com")
user.avatar_template_url.should == "//my.cdn.com/user_avatar/sam/{size}/99.png"
user.avatar_template_url.should == "//my.cdn.com/user_avatar/test.localhost/sam/{size}/99.png"
end
end