diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-01-20 21:29:51 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-01-20 21:29:51 +0000 |
commit | d6bfb7fa4da4068c3e64f3fce16574de56fd72e9 (patch) | |
tree | eec2bb152a3d5aa0782563baa38c59e170d1ea9c /test/functional/issues_controller_test.rb | |
parent | 59c5d995c339f726f7c6249d543a2b2a2a7bc061 (diff) | |
download | redmine-d6bfb7fa4da4068c3e64f3fce16574de56fd72e9.tar.gz redmine-d6bfb7fa4da4068c3e64f3fce16574de56fd72e9.zip |
Added default value for custom fields. Fixed javascript on custom field form for project and user custom fields.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1090 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/issues_controller_test.rb')
-rw-r--r-- | test/functional/issues_controller_test.rb | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 05bfc96e3..f4c99f1ed 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -34,7 +34,10 @@ class IssuesControllerTest < Test::Unit::TestCase :enabled_modules, :enumerations, :attachments, - :workflows + :workflows, + :custom_fields, + :custom_values, + :custom_fields_trackers def setup @controller = IssuesController.new @@ -132,6 +135,9 @@ class IssuesControllerTest < Test::Unit::TestCase get :new, :project_id => 1, :tracker_id => 1 assert_response :success assert_template 'new' + + assert_tag :tag => 'input', :attributes => { :name => 'custom_fields[2]', + :value => 'Default string' } end def test_get_new_without_tracker_id @@ -162,9 +168,16 @@ class IssuesControllerTest < Test::Unit::TestCase :issue => {:tracker_id => 1, :subject => 'This is the test_new issue', :description => 'This is the description', - :priority_id => 5} + :priority_id => 5}, + :custom_fields => {'2' => 'Value for field 2'} assert_redirected_to 'projects/ecookbook/issues' - assert Issue.find_by_subject('This is the test_new issue') + + issue = Issue.find_by_subject('This is the test_new issue') + assert_not_nil issue + assert_equal 2, issue.author_id + v = issue.custom_values.find_by_custom_field_id(2) + assert_not_nil v + assert_equal 'Value for field 2', v.value end def test_copy_issue |