mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 21:02:48 +08:00
correct letter avatar template
This commit is contained in:
parent
6d2e651862
commit
296add56e6
|
@ -417,7 +417,7 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def self.letter_avatar_template(username)
|
||||
"/letter_avatar/#{username.downcase}/{size}/#{LetterAvatar::VERSION}.png"
|
||||
"/letter_avatar/#{username.downcase}/{size}/#{LetterAvatar.version}.png"
|
||||
end
|
||||
|
||||
def avatar_template
|
||||
|
|
|
@ -860,7 +860,7 @@ describe User do
|
|||
let(:user) { build(:user, username: 'Sam') }
|
||||
|
||||
it "returns a 45-pixel-wide avatar" do
|
||||
expect(user.small_avatar_url).to eq("//test.localhost/letter_avatar/sam/45/#{LetterAvatar::VERSION}.png")
|
||||
expect(user.small_avatar_url).to eq("//test.localhost/letter_avatar/sam/45/#{LetterAvatar.version}.png")
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -1037,7 +1037,7 @@ describe User do
|
|||
u = User.create!(username: "bob", email: "bob@bob.com")
|
||||
u.reload
|
||||
expect(u.uploaded_avatar_id).to eq(nil)
|
||||
expect(u.avatar_template).to eq("/letter_avatar/bob/{size}/#{LetterAvatar::VERSION}.png")
|
||||
expect(u.avatar_template).to eq("/letter_avatar/bob/{size}/#{LetterAvatar.version}.png")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user