diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2019-10-19 08:30:15 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2019-10-19 08:30:15 +0000 |
commit | c5b5f0d6a9ab7e710da53a5043cc262e92928c51 (patch) | |
tree | 334938afbc038d2dc915526d1319e73088aec493 /test | |
parent | 57a66e950c94037e2b3ac4c8102af801957ff6cf (diff) | |
download | redmine-c5b5f0d6a9ab7e710da53a5043cc262e92928c51.tar.gz redmine-c5b5f0d6a9ab7e710da53a5043cc262e92928c51.zip |
Fixed that total estimated time column is shown even when estimated time field is deactivated (#31779).
Patch by Felix Schäfer and Yuichi HARADA.
git-svn-id: http://svn.redmine.org/redmine/trunk@18743 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/query_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb index 7888a4993..db0d4c884 100644 --- a/test/unit/query_test.rb +++ b/test/unit/query_test.rb @@ -2085,6 +2085,25 @@ class QueryTest < ActiveSupport::TestCase end end + def test_available_columns_should_not_include_total_estimated_hours_when_trackers_disabled_estimated_hours + Tracker.visible.each do |tracker| + tracker.core_fields = tracker.core_fields.reject{|field| field == 'estimated_hours'} + tracker.save! + end + query = IssueQuery.new + available_columns = query.available_columns.map(&:name) + assert_not_include :estimated_hours, available_columns + assert_not_include :total_estimated_hours, available_columns + + tracker = Tracker.visible.first + tracker.core_fields = ['estimated_hours'] + tracker.save! + query = IssueQuery.new + available_columns = query.available_columns.map(&:name) + assert_include :estimated_hours, available_columns + assert_include :total_estimated_hours, available_columns + end + def setup_member_of_group Group.destroy_all # No fixtures @user_in_group = User.generate! |