forked from hotsh/rstat.us
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request hotsh#611 from chrismdp/master
Upped gravatars and image protocols to https by default
- Loading branch information
Showing
2 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,18 @@ | |
assert_equal @author.remote_url, @author.url | ||
end | ||
|
||
it "ensures that image_url is always https" do | ||
@author.image_url = 'http://example.net/cool-avatar' | ||
@author.save! | ||
assert_equal 'https://example.net/cool-avatar', @author.image_url | ||
end | ||
|
||
it "ensures that https image_urls are untouched" do | ||
@author.image_url = 'https://example.net/cool-avatar' | ||
@author.save! | ||
assert_equal 'https://example.net/cool-avatar', @author.image_url | ||
end | ||
|
||
describe "#fully_qualified_name" do | ||
|
||
it "returns simple name if a local user" do | ||
|
@@ -47,14 +59,14 @@ | |
describe "#avatar_url" do | ||
|
||
it "returns image_url as avatar_url if image_url is set" do | ||
image_url = 'http://example.net/cool-avatar' | ||
image_url = 'https://example.net/cool-avatar' | ||
@author.image_url = image_url | ||
assert_equal image_url, @author.avatar_url | ||
assert_equal 'https://example.net/cool-avatar', @author.avatar_url | ||
end | ||
|
||
it "returns a gravatar if there is an email and image_url is not set" do | ||
it "returns https gravatar if there is an email and image_url is not set" do | ||
@author.email = "[email protected]" | ||
assert_match 'http://gravatar.com/', @author.avatar_url | ||
assert_match 'https://gravatar.com/', @author.avatar_url | ||
end | ||
|
||
it "uses the default avatar if neither image_url nor email is set" do | ||
|