summaryrefslogtreecommitdiffstats
path: root/test/functional/timelog_report_test.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-07-12 21:58:22 +0000
committerGo MAEDA <maeda@farend.jp>2018-07-12 21:58:22 +0000
commit391bc8b763c603b81a98292795a756c10ab3ef06 (patch)
tree133d8468b9697128c204da4b9bb6cba7c216b142 /test/functional/timelog_report_test.rb
parentcfae2f9037cbbdfcbce9457b704218536a3c33f2 (diff)
downloadredmine-391bc8b763c603b81a98292795a756c10ab3ef06.tar.gz
redmine-391bc8b763c603b81a98292795a756c10ab3ef06.zip
Only allow the use of visible custom fields in time entry reports (#29162).
Patch by Holger Just. git-svn-id: http://svn.redmine.org/redmine/trunk@17446 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/timelog_report_test.rb')
-rw-r--r--test/functional/timelog_report_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/timelog_report_test.rb b/test/functional/timelog_report_test.rb
index 35ec559fc..252a5909c 100644
--- a/test/functional/timelog_report_test.rb
+++ b/test/functional/timelog_report_test.rb
@@ -135,6 +135,18 @@ class TimelogReportTest < Redmine::ControllerTest
end
end
+ def test_hidden_custom_fields_should_not_be_proposed
+ TimeEntryCustomField.create!(name: 'shown', field_format: 'list', possible_values: ['value1', 'value2'], visible: true)
+ TimeEntryCustomField.create!(name: 'Hidden', field_format: 'list', possible_values: ['value1', 'value2'], visible: false)
+
+ get :report, :params => {:project_id => 1}
+ assert_response :success
+ assert_select 'select[name=?]', 'criteria[]' do
+ assert_select 'option', :text => 'Shown'
+ assert_select 'option', :text => 'Hidden', :count => 0
+ end
+ end
+
def test_report_one_day
get :report, :params => {:project_id => 1, :columns => 'day', :from => "2007-03-23", :to => "2007-03-23", :criteria => ["user", "activity"]}
assert_response :success