summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2018-09-23 08:25:25 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2018-09-23 08:25:25 +0000
commite856c9f879f15f31317ddfcf35042e799b90f783 (patch)
tree7101fb598e5f2ef9aebd519bd50cf6e1fe66b30c /test
parent55ee0b8f7f5626197e5a3bd919b0cd56276a632e (diff)
downloadredmine-e856c9f879f15f31317ddfcf35042e799b90f783.tar.gz
redmine-e856c9f879f15f31317ddfcf35042e799b90f783.zip
Fixed that issue details page shows default values for custom fields that aren't actually set (#25726).
git-svn-id: http://svn.redmine.org/redmine/trunk@17499 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/issues_controller_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index d01b990f9..0e2505eef 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -2134,6 +2134,20 @@ class IssuesControllerTest < Redmine::ControllerTest
end
end
+ def test_show_should_not_display_default_value_for_new_custom_field
+ prior = Issue.generate!
+ field = IssueCustomField.generate!(:name => 'WithDefault', :field_format => 'string', :default_value => 'DEFAULT')
+ after = Issue.generate!
+
+ get :show, :params => {:id => prior.id}
+ assert_response :success
+ assert_select ".cf_#{field.id} .value", :text => ''
+
+ get :show, :params => {:id => after.id}
+ assert_response :success
+ assert_select ".cf_#{field.id} .value", :text => 'DEFAULT'
+ end
+
def test_show_should_display_private_notes_with_permission_only
journal = Journal.create!(:journalized => Issue.find(2), :notes => 'Privates notes', :private_notes => true, :user_id => 1)
@request.session[:user_id] = 2