@@ -10,7 +10,7 | |||||
10 | <li><%=l(:field_mail)%>: <%= mail_to(h(@user.mail), nil, :encode => 'javascript') %></li> |
|
10 | <li><%=l(:field_mail)%>: <%= mail_to(h(@user.mail), nil, :encode => 'javascript') %></li> | |
11 | <% end %> |
|
11 | <% end %> | |
12 | <% for custom_value in @custom_values %> |
|
12 | <% for custom_value in @custom_values %> | |
13 |
<% if !custom_value.value. |
|
13 | <% if !custom_value.value.blank? %> | |
14 | <li><%=h custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li> |
|
14 | <li><%=h custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li> | |
15 | <% end %> |
|
15 | <% end %> | |
16 | <% end %> |
|
16 | <% end %> |
@@ -9,7 +9,7 | |||||
9 | <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ") %></li> |
|
9 | <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ") %></li> | |
10 | <% end %> |
|
10 | <% end %> | |
11 | <% @project.custom_values.each do |custom_value| %> |
|
11 | <% @project.custom_values.each do |custom_value| %> | |
12 |
<% if !custom_value.value. |
|
12 | <% if !custom_value.value.blank? %> | |
13 | <li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li> |
|
13 | <li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li> | |
14 | <% end %> |
|
14 | <% end %> | |
15 | <% end %> |
|
15 | <% end %> |
@@ -38,6 +38,18 class AccountControllerTest < ActionController::TestCase | |||||
38 | assert_not_nil assigns(:user) |
|
38 | assert_not_nil assigns(:user) | |
39 | end |
|
39 | end | |
40 |
|
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 | |||
|
51 | ||||
|
52 | ||||
41 | def test_show_inactive |
|
53 | def test_show_inactive | |
42 | get :show, :id => 5 |
|
54 | get :show, :id => 5 | |
43 | assert_response 404 |
|
55 | assert_response 404 |
@@ -161,6 +161,16 class ProjectsControllerTest < ActionController::TestCase | |||||
161 | assert_equal Project.find_by_identifier('ecookbook'), assigns(:project) |
|
161 | assert_equal Project.find_by_identifier('ecookbook'), assigns(:project) | |
162 | end |
|
162 | end | |
163 |
|
163 | |||
|
164 | def test_show_should_not_fail_when_custom_values_are_nil | |||
|
165 | project = Project.find_by_identifier('ecookbook') | |||
|
166 | project.custom_values.first.update_attribute(:value, nil) | |||
|
167 | get :show, :id => 'ecookbook' | |||
|
168 | assert_response :success | |||
|
169 | assert_template 'show' | |||
|
170 | assert_not_nil assigns(:project) | |||
|
171 | assert_equal Project.find_by_identifier('ecookbook'), assigns(:project) | |||
|
172 | end | |||
|
173 | ||||
164 | def test_private_subprojects_hidden |
|
174 | def test_private_subprojects_hidden | |
165 | get :show, :id => 'ecookbook' |
|
175 | get :show, :id => 'ecookbook' | |
166 | assert_response :success |
|
176 | assert_response :success |
General Comments 0
You need to be logged in to leave comments.
Login now