Makes spent time column available on the issue list (#971).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8073 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2011-12-04 16:43:32 +00:00
parent bddd19c1e6
commit 6d498a3c46
6 changed files with 70 additions and 6 deletions
+23
View File
@@ -537,6 +537,13 @@ class IssuesControllerTest < ActionController::TestCase
get :index, :group_by => 'author', :sort => 'priority'
assert_response :success
end
def test_index_group_by_spent_hours
get :index, :group_by => 'author', :sort => 'spent_hours:desc'
assert_response :success
hours = assigns(:issues).collect(&:spent_hours)
assert_equal hours.sort.reverse, hours
end
def test_index_with_columns
columns = ['tracker', 'subject', 'assigned_to']
@@ -615,6 +622,22 @@ class IssuesControllerTest < ActionController::TestCase
}
end
def test_index_with_spent_hours_column
get :index, :set_filter => 1, :c => %w(subject spent_hours)
assert_tag 'tr', :attributes => {:id => 'issue-3'},
:child => {
:tag => 'td', :attributes => {:class => /spent_hours/}, :content => '1.00'
}
end
def test_index_should_not_show_spent_hours_column_without_permission
Role.anonymous.remove_permission! :view_time_entries
get :index, :set_filter => 1, :c => %w(subject spent_hours)
assert_no_tag 'td', :attributes => {:class => /spent_hours/}
end
def test_index_with_fixed_version
get :index, :set_filter => 1, :c => %w(fixed_version)
assert_tag 'td', :attributes => {:class => /fixed_version/},