Additional tests for custom field formats.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10004 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-07-15 19:30:47 +00:00
parent 471f631dbd
commit ba647689f4
1 changed files with 20 additions and 0 deletions

View File

@ -1371,6 +1371,26 @@ class IssuesControllerTest < ActionController::TestCase
:attributes => {:name => "issue[custom_field_values][#{field.id}][]", :value => ''} :attributes => {:name => "issue[custom_field_values][#{field.id}][]", :value => ''}
end end
def test_get_new_with_date_custom_field
field = IssueCustomField.create!(:name => 'Date', :field_format => 'date', :tracker_ids => [1], :is_for_all => true)
@request.session[:user_id] = 2
get :new, :project_id => 1, :tracker_id => 1
assert_response :success
assert_select 'input[name=?]', "issue[custom_field_values][#{field.id}]"
end
def test_get_new_with_text_custom_field
field = IssueCustomField.create!(:name => 'Text', :field_format => 'text', :tracker_ids => [1], :is_for_all => true)
@request.session[:user_id] = 2
get :new, :project_id => 1, :tracker_id => 1
assert_response :success
assert_select 'textarea[name=?]', "issue[custom_field_values][#{field.id}]"
end
def test_get_new_without_default_start_date_is_creation_date def test_get_new_without_default_start_date_is_creation_date
Setting.default_issue_start_date_to_creation_date = 0 Setting.default_issue_start_date_to_creation_date = 0