@@ -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><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li> |
|
14 | <li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li> | |
15 | <% end %> |
|
15 | <% end %> | |
16 | <% end %> |
|
16 | <% end %> |
@@ -11,7 +11,7 | |||||
11 | <li><%=l(:field_parent)%>: <%= link_to h(@project.parent.name), :controller => 'projects', :action => 'show', :id => @project.parent %></li> |
|
11 | <li><%=l(:field_parent)%>: <%= link_to h(@project.parent.name), :controller => 'projects', :action => 'show', :id => @project.parent %></li> | |
12 | <% end %> |
|
12 | <% end %> | |
13 | <% @project.custom_values.each do |custom_value| %> |
|
13 | <% @project.custom_values.each do |custom_value| %> | |
14 |
<% if !custom_value.value. |
|
14 | <% if !custom_value.value.blank? %> | |
15 | <li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li> |
|
15 | <li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li> | |
16 | <% end %> |
|
16 | <% end %> | |
17 | <% end %> |
|
17 | <% end %> |
@@ -37,7 +37,19 class AccountControllerTest < Test::Unit::TestCase | |||||
37 | assert_template 'show' |
|
37 | assert_template 'show' | |
38 | assert_not_nil assigns(:user) |
|
38 | assert_not_nil assigns(:user) | |
39 | end |
|
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 | 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 |
@@ -68,6 +68,16 class ProjectsControllerTest < Test::Unit::TestCase | |||||
68 | assert_equal Project.find_by_identifier('ecookbook'), assigns(:project) |
|
68 | assert_equal Project.find_by_identifier('ecookbook'), assigns(:project) | |
69 | end |
|
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 | def test_private_subprojects_hidden |
|
81 | def test_private_subprojects_hidden | |
72 | get :show, :id => 'ecookbook' |
|
82 | get :show, :id => 'ecookbook' | |
73 | assert_response :success |
|
83 | assert_response :success |
General Comments 0
You need to be logged in to leave comments.
Login now