A platform for community discussion. Free, open, simple.
FIX: ensure avatar sizes are integers
Régis Hanol00dbc260d3dc
diff --git a/lib/discourse.rb b/lib/discourse.rbindex 86efda52355..5a13c19d356 100644--- a/lib/discourse.rb+++ b/lib/discourse.rb@@ -135,7 +135,7 @@ module DiscourseSiteSetting.avatar_sizes.split("|").map(&:to_i).each do |size|PIXEL_RATIOS.each do |pixel_ratio|- set << size * pixel_ratio+ set << (size * pixel_ratio).to_iendenddiff --git a/spec/components/discourse_spec.rb b/spec/components/discourse_spec.rbindex 9b3dc50b4ca..76a832c6d08 100644--- a/spec/components/discourse_spec.rb+++ b/spec/components/discourse_spec.rb@@ -10,11 +10,15 @@ describe Discourse doendcontext 'current_hostname' do-it 'returns the hostname from the current db connection' doexpect(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)+ endendcontext 'running_in_rack' do