@@ -41,10 +41,10 | |||||
41 | unless @issue.disabled_core_fields.include?('assigned_to_id') |
|
41 | unless @issue.disabled_core_fields.include?('assigned_to_id') | |
42 | rows.left l(:field_assigned_to), avatar(@issue.assigned_to, :size => "14").to_s.html_safe + (@issue.assigned_to ? link_to_user(@issue.assigned_to) : "-"), :class => 'assigned-to' |
|
42 | rows.left l(:field_assigned_to), avatar(@issue.assigned_to, :size => "14").to_s.html_safe + (@issue.assigned_to ? link_to_user(@issue.assigned_to) : "-"), :class => 'assigned-to' | |
43 | end |
|
43 | end | |
44 | unless @issue.disabled_core_fields.include?('category_id') |
|
44 | unless @issue.disabled_core_fields.include?('category_id') || (@issue.category.nil? && @issue.project.issue_categories.none?) | |
45 | rows.left l(:field_category), (@issue.category ? @issue.category.name : "-"), :class => 'category' |
|
45 | rows.left l(:field_category), (@issue.category ? @issue.category.name : "-"), :class => 'category' | |
46 | end |
|
46 | end | |
47 | unless @issue.disabled_core_fields.include?('fixed_version_id') |
|
47 | unless @issue.disabled_core_fields.include?('fixed_version_id') || (@issue.fixed_version.nil? && @issue.assignable_versions.none?) | |
48 | rows.left l(:field_fixed_version), (@issue.fixed_version ? link_to_version(@issue.fixed_version) : "-"), :class => 'fixed-version' |
|
48 | rows.left l(:field_fixed_version), (@issue.fixed_version ? link_to_version(@issue.fixed_version) : "-"), :class => 'fixed-version' | |
49 | end |
|
49 | end | |
50 |
|
50 |
@@ -1377,6 +1377,22 class IssuesControllerTest < ActionController::TestCase | |||||
1377 | end |
|
1377 | end | |
1378 | end |
|
1378 | end | |
1379 |
|
1379 | |||
|
1380 | def test_show_should_display_category_field_if_categories_are_defined | |||
|
1381 | Issue.update_all :category_id => nil | |||
|
1382 | ||||
|
1383 | get :show, :id => 1 | |||
|
1384 | assert_response :success | |||
|
1385 | assert_select 'table.attributes .category' | |||
|
1386 | end | |||
|
1387 | ||||
|
1388 | def test_show_should_not_display_category_field_if_no_categories_are_defined | |||
|
1389 | Project.find(1).issue_categories.delete_all | |||
|
1390 | ||||
|
1391 | get :show, :id => 1 | |||
|
1392 | assert_response :success | |||
|
1393 | assert_select 'table.attributes .category', 0 | |||
|
1394 | end | |||
|
1395 | ||||
1380 | def test_show_should_display_link_to_the_assignee |
|
1396 | def test_show_should_display_link_to_the_assignee | |
1381 | get :show, :id => 2 |
|
1397 | get :show, :id => 2 | |
1382 | assert_response :success |
|
1398 | assert_response :success |
General Comments 0
You need to be logged in to leave comments.
Login now