Extracts custom field values validation from CustomValue so that they can be validated globally from the customized object (#1189).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8717 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-01-28 11:16:58 +00:00
parent d4d27bd2d8
commit 83e7ee6729
11 changed files with 249 additions and 193 deletions
+9 -8
View File
@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2011 Jean-Philippe Lang
# Copyright (C) 2006-2012 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
@@ -1308,17 +1308,18 @@ class IssuesControllerTest < ActionController::TestCase
field.update_attribute(:is_required, true)
@request.session[:user_id] = 2
post :create, :project_id => 1,
:issue => {:tracker_id => 1,
:subject => 'This is the test_new issue',
:description => 'This is the description',
:priority_id => 5}
assert_no_difference 'Issue.count' do
post :create, :project_id => 1,
:issue => {:tracker_id => 1,
:subject => 'This is the test_new issue',
:description => 'This is the description',
:priority_id => 5}
end
assert_response :success
assert_template 'new'
issue = assigns(:issue)
assert_not_nil issue
assert_equal I18n.translate('activerecord.errors.messages.invalid'),
issue.errors[:custom_values].to_s
assert_error_tag :content => /Database can't be blank/
end
def test_post_create_with_watchers