missed one spot where route changed
This commit is contained in:
parent
663c57a0f0
commit
1e28668e9f
|
@ -354,7 +354,7 @@ class User < ActiveRecord::Base
|
||||||
def self.avatar_template(username,uploaded_avatar_id)
|
def self.avatar_template(username,uploaded_avatar_id)
|
||||||
id = uploaded_avatar_id || -1
|
id = uploaded_avatar_id || -1
|
||||||
username ||= ""
|
username ||= ""
|
||||||
"/user_avatar/#{username.downcase}/{size}/#{id}.png"
|
"/user_avatar/#{RailsMultisite::ConnectionManagement.current_hostname}/#{username.downcase}/{size}/#{id}.png"
|
||||||
end
|
end
|
||||||
|
|
||||||
def avatar_template
|
def avatar_template
|
||||||
|
|
|
@ -978,7 +978,7 @@ describe User do
|
||||||
let(:user) { build(:user, username: 'Sam') }
|
let(:user) { build(:user, username: 'Sam') }
|
||||||
|
|
||||||
it "returns a 45-pixel-wide avatar" do
|
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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -988,12 +988,12 @@ describe User do
|
||||||
let(:user) { build(:user, uploaded_avatar_id: 99, username: 'Sam') }
|
let(:user) { build(:user, uploaded_avatar_id: 99, username: 'Sam') }
|
||||||
|
|
||||||
it "returns a schemaless avatar template with correct id" do
|
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
|
end
|
||||||
|
|
||||||
it "returns a schemaless cdn-based avatar template" do
|
it "returns a schemaless cdn-based avatar template" do
|
||||||
Rails.configuration.action_controller.stubs(:asset_host).returns("http://my.cdn.com")
|
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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue