Fix rspec tests.
This commit is contained in:
parent
6057e17ae7
commit
a1d04a7a9a
|
@ -74,15 +74,15 @@ class LetterAvatar
|
||||||
-size #{FULLSIZE}x#{FULLSIZE}
|
-size #{FULLSIZE}x#{FULLSIZE}
|
||||||
xc:#{to_rgb(color)}
|
xc:#{to_rgb(color)}
|
||||||
-pointsize #{POINTSIZE}
|
-pointsize #{POINTSIZE}
|
||||||
-fill '#FFFFFFCC'
|
-fill #FFFFFFCC
|
||||||
-font 'Helvetica'
|
-font Helvetica
|
||||||
-gravity Center
|
-gravity Center
|
||||||
-annotate -0+26 '#{letter}'
|
-annotate -0+26 #{letter}
|
||||||
-depth 8
|
-depth 8
|
||||||
'#{filename}'
|
#{filename}
|
||||||
}
|
}
|
||||||
|
|
||||||
Discourse::Utils.execute_command('convert', instructions.join(" ".freeze)) rescue nil
|
Discourse::Utils.execute_command('convert', *instructions)
|
||||||
|
|
||||||
## do not optimize image, it will end up larger than original
|
## do not optimize image, it will end up larger than original
|
||||||
filename
|
filename
|
||||||
|
@ -90,7 +90,7 @@ class LetterAvatar
|
||||||
|
|
||||||
def to_rgb(color)
|
def to_rgb(color)
|
||||||
r,g,b = color
|
r,g,b = color
|
||||||
"'rgb(#{r},#{g},#{b})'"
|
"rgb(#{r},#{g},#{b})"
|
||||||
end
|
end
|
||||||
|
|
||||||
def image_magick_version
|
def image_magick_version
|
||||||
|
|
|
@ -10,7 +10,7 @@ describe UserAvatarsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns an avatar if we are allowing the proxy' do
|
it 'returns an avatar if we are allowing the proxy' do
|
||||||
response = get :show_proxy_letter, version: 'v2', letter: 'a', color: 'aaaaaa', size: 20
|
response = get :show_proxy_letter, version: 'v2', letter: 'a', color: 'aaaaaa', size: 360
|
||||||
expect(response.status).to eq(200)
|
expect(response.status).to eq(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue