diff --git a/app/views/contact/new.rhtml b/app/views/contact/new.rhtml
index ffcaac0..903fc5a 100644
--- a/app/views/contact/new.rhtml
+++ b/app/views/contact/new.rhtml
@@ -1,6 +1,10 @@
-
<%= _('Send an e-mail to administrators') %>
+<% if profile.person? %>
+ <%= _('Send an e-mail to %s') % profile.name %>
+<% else %>
+ <%= _('Send an e-mail to administrators') %>
-<%= _("The e-mail will be sent to the administrator of community '%s'") % profile.name %>
+ <%= _("The e-mail will be sent to the administrators of community '%s'") % profile.name %>
+<% end %>
<%= error_messages_for 'contact' %>
diff --git a/test/functional/contact_controller_test.rb b/test/functional/contact_controller_test.rb
index 4d6cfec..f30f56b 100644
--- a/test/functional/contact_controller_test.rb
+++ b/test/functional/contact_controller_test.rb
@@ -25,9 +25,24 @@ class ContactControllerTest < ActionController::TestCase
assert_response :success
end
- should 'display destinatary name in title' do
+ should 'display destinatary name in title if profile is a person' do
+ get :new, :profile => profile.identifier
+ assert_tag :tag => 'h1', :content => /Send.*#{profile.name}/
+ end
+
+ should 'display administrators in title if profile is an organization' do
get :new, :profile => enterprise.identifier
- assert_tag :tag => 'h1', :content => /Send.*#{enterprise.name}/
+ assert_tag :tag => 'h1', :content => /Send.*administrators/
+ end
+
+ should 'display profile name in tooltip if profile is an organization' do
+ get :new, :profile => enterprise.identifier
+ assert_tag :tag => 'div', :content => /administrators.*#{enterprise.name}/, :attributes => {:class => 'tooltip'}
+ end
+
+ should 'not display tooltip if profile is a person' do
+ get :new, :profile => profile.identifier
+ assert_no_tag :tag => 'div', :attributes => {:class => 'tooltip'}
end
should 'add form to create contact via post' do
--
libgit2 0.21.2