mirror of
https://github.com/redmine/redmine.git
synced 2025-11-01 02:46:13 +01:00
Fixed: start date being filled with current date even when blank value is submitted (#6575).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4378 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -378,6 +378,7 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
:subject => 'This is the test_new issue',
|
||||
:description => 'This is the description',
|
||||
:priority_id => 5,
|
||||
:start_date => '2010-11-07',
|
||||
:estimated_hours => '',
|
||||
:custom_field_values => {'2' => 'Value for field 2'}}
|
||||
end
|
||||
@@ -388,12 +389,33 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
assert_equal 2, issue.author_id
|
||||
assert_equal 3, issue.tracker_id
|
||||
assert_equal 2, issue.status_id
|
||||
assert_equal Date.parse('2010-11-07'), issue.start_date
|
||||
assert_nil issue.estimated_hours
|
||||
v = issue.custom_values.find(:first, :conditions => {:custom_field_id => 2})
|
||||
assert_not_nil v
|
||||
assert_equal 'Value for field 2', v.value
|
||||
end
|
||||
|
||||
def test_post_create_without_start_date
|
||||
@request.session[:user_id] = 2
|
||||
assert_difference 'Issue.count' do
|
||||
post :create, :project_id => 1,
|
||||
:issue => {:tracker_id => 3,
|
||||
:status_id => 2,
|
||||
:subject => 'This is the test_new issue',
|
||||
:description => 'This is the description',
|
||||
:priority_id => 5,
|
||||
:start_date => '',
|
||||
:estimated_hours => '',
|
||||
:custom_field_values => {'2' => 'Value for field 2'}}
|
||||
end
|
||||
assert_redirected_to :controller => 'issues', :action => 'show', :id => Issue.last.id
|
||||
|
||||
issue = Issue.find_by_subject('This is the test_new issue')
|
||||
assert_not_nil issue
|
||||
assert_nil issue.start_date
|
||||
end
|
||||
|
||||
def test_post_create_and_continue
|
||||
@request.session[:user_id] = 2
|
||||
post :create, :project_id => 1,
|
||||
|
||||
Reference in New Issue
Block a user