##// END OF EJS Templates
Merged r2894 from trunk....
Jean-Philippe Lang -
r2882:4be1c1ad5861
parent child
Show More
@@ -10,7 +10,7
10 10 <li><%=l(:field_mail)%>: <%= mail_to(h(@user.mail), nil, :encode => 'javascript') %></li>
11 11 <% end %>
12 12 <% for custom_value in @custom_values %>
13 <% if !custom_value.value.empty? %>
13 <% if !custom_value.value.blank? %>
14 14 <li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li>
15 15 <% end %>
16 16 <% end %>
@@ -11,7 +11,7
11 11 <li><%=l(:field_parent)%>: <%= link_to h(@project.parent.name), :controller => 'projects', :action => 'show', :id => @project.parent %></li>
12 12 <% end %>
13 13 <% @project.custom_values.each do |custom_value| %>
14 <% if !custom_value.value.empty? %>
14 <% if !custom_value.value.blank? %>
15 15 <li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li>
16 16 <% end %>
17 17 <% end %>
@@ -37,7 +37,19 class AccountControllerTest < Test::Unit::TestCase
37 37 assert_template 'show'
38 38 assert_not_nil assigns(:user)
39 39 end
40
41 def test_show_should_not_fail_when_custom_values_are_nil
42 user = User.find(2)
43
44 # Create a custom field to illustrate the issue
45 custom_field = CustomField.create!(:name => 'Testing', :field_format => 'text')
46 custom_value = user.custom_values.build(:custom_field => custom_field).save!
47
48 get :show, :id => 2
49 assert_response :success
50 end
40 51
52
41 53 def test_show_inactive
42 54 get :show, :id => 5
43 55 assert_response 404
@@ -68,6 +68,16 class ProjectsControllerTest < Test::Unit::TestCase
68 68 assert_equal Project.find_by_identifier('ecookbook'), assigns(:project)
69 69 end
70 70
71 def test_show_should_not_fail_when_custom_values_are_nil
72 project = Project.find_by_identifier('ecookbook')
73 project.custom_values.first.update_attribute(:value, nil)
74 get :show, :id => 'ecookbook'
75 assert_response :success
76 assert_template 'show'
77 assert_not_nil assigns(:project)
78 assert_equal Project.find_by_identifier('ecookbook'), assigns(:project)
79 end
80
71 81 def test_private_subprojects_hidden
72 82 get :show, :id => 'ecookbook'
73 83 assert_response :success
General Comments 0
You need to be logged in to leave comments. Login now