diff options
author | Jan-Gerd Tenberge <janten@gmail.com> | 2015-09-26 21:53:16 +0300 |
---|---|---|
committer | Jan-Gerd Tenberge <janten@gmail.com> | 2015-09-26 21:53:16 +0300 |
commit | 3ef71fa4fbea9a5ecc3c094df39cf4ea2f97dc90 (patch) | |
tree | 9f6d2812099708cc862b84a76bce9871d0d06fa6 /spec/helpers | |
parent | 4957415e00207e0eae6184237f19bcd7c7401598 (diff) |
Add support for HiDPI displays in gravatar service
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/application_helper_spec.rb | 12 |
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 |