Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request rubysherpas#243 from beefsack/gravatar-protocol-fix
Browse files Browse the repository at this point in the history
Removed protocol from gravatar url to allow https.
  • Loading branch information
parndt committed Jun 13, 2012
2 parents 3dda6a2 + 9ed2d82 commit fe18d8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/helpers/forem/posts_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def avatar_url(email, options = {})
options[:s] = options.delete(:size) || 60
options[:d] = options.delete(:default) || default_gravatar
options.delete(:d) unless options[:d]
"http://www.gravatar.com/avatar/#{md5}?#{options.to_param}"
"//www.gravatar.com/avatar/#{md5}?#{options.to_param}"
end

def default_gravatar
Expand Down
8 changes: 4 additions & 4 deletions spec/helpers/posts_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Forem
let(:opts) { {} }

it 'includes the default size' do
expected = "http://www.gravatar.com/avatar/#{email_hash}?s=60"
expected = "//www.gravatar.com/avatar/#{email_hash}?s=60"
helper.avatar_url(email, opts).should eq(expected)
end
end
Expand All @@ -19,7 +19,7 @@ module Forem
let(:opts) { {:size => 99} }

it 'overwrites the default size' do
expected = "http://www.gravatar.com/avatar/#{email_hash}?s=99"
expected = "//www.gravatar.com/avatar/#{email_hash}?s=99"
helper.avatar_url(email, opts).should eq(expected)
end
end
Expand All @@ -28,7 +28,7 @@ module Forem
let(:opts) { {:default => 'mm'} }

it 'includes a default parameter' do
expected = "http://www.gravatar.com/avatar/#{email_hash}?d=mm&s=60"
expected = "//www.gravatar.com/avatar/#{email_hash}?d=mm&s=60"
helper.avatar_url(email, opts).should eq(expected)
end
end
Expand All @@ -37,7 +37,7 @@ module Forem
let(:opts) { {:default => 'mm', :size => '99'} }

it 'includes a default parameter and overwrites the default size' do
expected = "http://www.gravatar.com/avatar/#{email_hash}?d=mm&s=99"
expected = "//www.gravatar.com/avatar/#{email_hash}?d=mm&s=99"
helper.avatar_url(email, opts).should eq(expected)
end
end
Expand Down

0 comments on commit fe18d8d

Please sign in to comment.