summaryrefslogtreecommitdiffstats
path: root/test/helpers/application_helper_test.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-05-04 15:59:50 +0000
committerGo MAEDA <maeda@farend.jp>2019-05-04 15:59:50 +0000
commitbf0246ce83b3fe1dcc986bc4fc6acbc513330edd (patch)
treec31ffd9c10b608d8b48c4900bf1afa4c958a3678 /test/helpers/application_helper_test.rb
parent400e1ca2ffffa9f2d4383e30c8c2c0e0b02c964b (diff)
downloadredmine-bf0246ce83b3fe1dcc986bc4fc6acbc513330edd.tar.gz
redmine-bf0246ce83b3fe1dcc986bc4fc6acbc513330edd.zip
Add avatar_server_url configuration option in order to support Libravatar (#9112).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@18124 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/helpers/application_helper_test.rb')
-rw-r--r--test/helpers/application_helper_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb
index 74acae4b0..b91012b58 100644
--- a/test/helpers/application_helper_test.rb
+++ b/test/helpers/application_helper_test.rb
@@ -1529,6 +1529,21 @@ RAW
end
end
+ def test_avatar_server_url
+ to_test = {
+ 'https://www.gravatar.com' => %r|https://www.gravatar.com/avatar/\h{32}|,
+ 'https://seccdn.libravatar.org' => %r|https://seccdn.libravatar.org/avatar/\h{32}|,
+ 'http://localhost:8080' => %r|http://localhost:8080/avatar/\h{32}|,
+ }
+ with_settings :gravatar_enabled => '1' do
+ to_test.each do |url, expected|
+ Redmine::Configuration.with 'avatar_server_url' => url do
+ assert_match expected, avatar('<jsmith@somenet.foo>')
+ end
+ end
+ end
+ end
+
def test_link_to_user
user = User.find(2)
result = link_to("John Smith", "/users/2", :class => "user active")