diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-04-01 13:44:58 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-04-01 13:44:58 +0000 |
commit | 1cd6a2aa84db83b127cc037021dc6351877790d0 (patch) | |
tree | ae3eaa0a3f6d15c62771db779f19f15fce4b1d87 /test/functional/custom_fields_controller_test.rb | |
parent | 122ba564b9c5c475c360e45af51fa92cfe969657 (diff) | |
download | redmine-1cd6a2aa84db83b127cc037021dc6351877790d0.tar.gz redmine-1cd6a2aa84db83b127cc037021dc6351877790d0.zip |
Adds User and Version custom field format that can be used to reference a project member or version in custom fields (#2096).
These new field formats are available for project, issue, version and time entry custom fields.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5272 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/custom_fields_controller_test.rb')
-rw-r--r-- | test/functional/custom_fields_controller_test.rb | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/test/functional/custom_fields_controller_test.rb b/test/functional/custom_fields_controller_test.rb index d1e251b5c..5e665ec13 100644 --- a/test/functional/custom_fields_controller_test.rb +++ b/test/functional/custom_fields_controller_test.rb @@ -1,5 +1,5 @@ # Redmine - project management software -# Copyright (C) 2006-2009 Jean-Philippe Lang +# Copyright (C) 2006-2011 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -31,6 +31,31 @@ class CustomFieldsControllerTest < ActionController::TestCase @request.session[:user_id] = 1 end + def test_get_new_issue_custom_field + get :new, :type => 'IssueCustomField' + assert_response :success + assert_template 'new' + assert_tag :select, + :attributes => {:name => 'custom_field[field_format]'}, + :child => { + :tag => 'option', + :attributes => {:value => 'user'}, + :content => 'User' + } + assert_tag :select, + :attributes => {:name => 'custom_field[field_format]'}, + :child => { + :tag => 'option', + :attributes => {:value => 'version'}, + :content => 'Version' + } + end + + def test_get_new_with_invalid_custom_field_class_should_redirect_to_list + get :new, :type => 'UnknownCustomField' + assert_redirected_to '/custom_fields' + end + def test_post_new_list_custom_field assert_difference 'CustomField.count' do post :new, :type => "IssueCustomField", @@ -53,9 +78,4 @@ class CustomFieldsControllerTest < ActionController::TestCase assert_equal ["0.1", "0.2"], field.possible_values assert_equal 1, field.trackers.size end - - def test_invalid_custom_field_class_should_redirect_to_list - get :new, :type => 'UnknownCustomField' - assert_redirected_to '/custom_fields' - end end |