FIX: ensure avatar sizes are integers
This commit is contained in:
parent
0f67350764
commit
00dbc260d3
|
@ -135,7 +135,7 @@ module Discourse
|
|||
|
||||
SiteSetting.avatar_sizes.split("|").map(&:to_i).each do |size|
|
||||
PIXEL_RATIOS.each do |pixel_ratio|
|
||||
set << size * pixel_ratio
|
||||
set << (size * pixel_ratio).to_i
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -10,11 +10,15 @@ describe Discourse do
|
|||
end
|
||||
|
||||
context 'current_hostname' do
|
||||
|
||||
it 'returns the hostname from the current db connection' do
|
||||
expect(Discourse.current_hostname).to eq('foo.com')
|
||||
end
|
||||
end
|
||||
|
||||
context 'avatar_sizes' do
|
||||
it 'returns a list of integers' do
|
||||
expect(Discourse.avatar_sizes).to contain_exactly(20, 25, 30, 32, 37, 40, 45, 48, 50, 60, 64, 67, 75, 90, 96, 120, 135, 180, 240, 360)
|
||||
end
|
||||
end
|
||||
|
||||
context 'running_in_rack' do
|
||||
|
|
Loading…
Reference in New Issue