summaryrefslogtreecommitdiff
path: root/spec/helpers/application_helper_spec.rb
diff options
context:
space:
mode:
authorJan-Gerd Tenberge <janten@gmail.com>2015-09-26 20:53:16 +0200
committerJan-Gerd Tenberge <janten@gmail.com>2015-09-26 20:53:16 +0200
commit3ef71fa4fbea9a5ecc3c094df39cf4ea2f97dc90 (patch)
tree9f6d2812099708cc862b84a76bce9871d0d06fa6 /spec/helpers/application_helper_spec.rb
parent4957415e00207e0eae6184237f19bcd7c7401598 (diff)
downloadgitlab-ce-3ef71fa4fbea9a5ecc3c094df39cf4ea2f97dc90.tar.gz
Add support for HiDPI displays in gravatar service
Diffstat (limited to 'spec/helpers/application_helper_spec.rb')
-rw-r--r--spec/helpers/application_helper_spec.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
index 742420f550e..e6e9bc99a16 100644
--- a/spec/helpers/application_helper_spec.rb
+++ b/spec/helpers/application_helper_spec.rb
@@ -141,15 +141,19 @@ describe ApplicationHelper do
stub_gravatar_setting(plain_url: 'http://example.local/?s=%{size}&hash=%{hash}')
expect(gravatar_icon(user_email, 20)).
- to eq('http://example.local/?s=20&hash=b58c6f14d292556214bd64909bcdb118')
+ to eq('http://example.local/?s=40&hash=b58c6f14d292556214bd64909bcdb118')
end
it 'accepts a custom size argument' do
- expect(helper.gravatar_icon(user_email, 64)).to include '?s=64'
+ expect(helper.gravatar_icon(user_email, 64)).to include '?s=128'
end
- it 'defaults size to 40 when given an invalid size' do
- expect(helper.gravatar_icon(user_email, nil)).to include '?s=40'
+ it 'defaults size to 40@2x when given an invalid size' do
+ expect(helper.gravatar_icon(user_email, nil)).to include '?s=80'
+ end
+
+ it 'accepts a scaling factor' do
+ expect(helper.gravatar_icon(user_email, 40, 3)).to include '?s=120'
end
it 'ignores case and surrounding whitespace' do