From 1e28668e9fb75e103675de46a2c394dd595bd03c Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 28 May 2014 01:08:45 +1000 Subject: [PATCH] missed one spot where route changed --- app/models/user.rb | 2 +- spec/models/user_spec.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 9d924f29426..1507a0f8c00 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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 diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 6687ac07c5b..4dd25e8de73 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -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