summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2013-05-10 04:37:31 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2013-05-10 04:37:31 +0000
commite1ba9012c68509b3debdaeb14b5ea1ef0c0f0c53 (patch)
tree50dbf48d56703cbccd1a1532ef93f858b94264ab
parenta3766c528194b585d1882bc68c740f1c592c207b (diff)
downloadredmine-e1ba9012c68509b3debdaeb14b5ea1ef0c0f0c53.tar.gz
redmine-e1ba9012c68509b3debdaeb14b5ea1ef0c0f0c53.zip
use with_settings at test_post_create_without_start_date_and_default_start_date_is_not_creation_date of IssuesControllerTest
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11820 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/functional/issues_controller_test.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index fd6726347..1143cef69 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -1767,11 +1767,10 @@ class IssuesControllerTest < ActionController::TestCase
end
def test_post_create_without_start_date_and_default_start_date_is_not_creation_date
- Setting.default_issue_start_date_to_creation_date = 0
-
- @request.session[:user_id] = 2
- assert_difference 'Issue.count' do
- post :create, :project_id => 1,
+ with_settings :default_issue_start_date_to_creation_date => 0 do
+ @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',
@@ -1779,12 +1778,13 @@ class IssuesControllerTest < ActionController::TestCase
:priority_id => 5,
: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
- 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_without_start_date_and_default_start_date_is_creation_date