diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2013-05-18 12:55:24 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2013-05-18 12:55:24 +0000 |
commit | de394f5f74e0dbf03c54c006ce4e830921515f99 (patch) | |
tree | 816428772b5588ebf2752a595a26c59b5c17e6fd /test/unit | |
parent | 23527da802bb94dacbd38b636bd7a8a216e3d1eb (diff) | |
download | redmine-de394f5f74e0dbf03c54c006ce4e830921515f99.tar.gz redmine-de394f5f74e0dbf03c54c006ce4e830921515f99.zip |
fix unit VersionTest failure
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11868 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/version_test.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/unit/version_test.rb b/test/unit/version_test.rb index 6564dcfd7..6f74eac36 100644 --- a/test/unit/version_test.rb +++ b/test/unit/version_test.rb @@ -143,7 +143,7 @@ class VersionTest < ActiveSupport::TestCase end test "#behind_schedule? should be false if all of the issues are ahead of schedule" do - version = Version.generate!(:effective_date => 7.days.from_now.to_date) + version = Version.create!(:project_id => 1, :name => 'test', :effective_date => 7.days.from_now.to_date) add_issue(version, :start_date => 7.days.ago, :done_ratio => 60) # 14 day span, 60% done, 50% time left add_issue(version, :start_date => 7.days.ago, :done_ratio => 60) # 14 day span, 60% done, 50% time left assert_equal 60, version.completed_percent @@ -151,7 +151,7 @@ class VersionTest < ActiveSupport::TestCase end test "#behind_schedule? should be true if any of the issues are behind schedule" do - version = Version.generate!(:effective_date => 7.days.from_now.to_date) + version = Version.create!(:project_id => 1, :name => 'test', :effective_date => 7.days.from_now.to_date) add_issue(version, :start_date => 7.days.ago, :done_ratio => 60) # 14 day span, 60% done, 50% time left add_issue(version, :start_date => 7.days.ago, :done_ratio => 20) # 14 day span, 20% done, 50% time left assert_equal 40, version.completed_percent @@ -159,7 +159,7 @@ class VersionTest < ActiveSupport::TestCase end test "#behind_schedule? should be false if all of the issues are complete" do - version = Version.generate!(:effective_date => 7.days.from_now.to_date) + version = Version.create!(:project_id => 1, :name => 'test', :effective_date => 7.days.from_now.to_date) add_issue(version, :start_date => 14.days.ago, :done_ratio => 100, :status => IssueStatus.find(5)) # 7 day span add_issue(version, :start_date => 14.days.ago, :done_ratio => 100, :status => IssueStatus.find(5)) # 7 day span assert_equal 100, version.completed_percent @@ -172,20 +172,20 @@ class VersionTest < ActiveSupport::TestCase end test "#estimated_hours should return 0 with no estimated hours" do - version = Version.generate! + version = Version.create!(:project_id => 1, :name => 'test') add_issue(version) assert_equal 0, version.estimated_hours end test "#estimated_hours should return return the sum of estimated hours" do - version = Version.generate! + version = Version.create!(:project_id => 1, :name => 'test') add_issue(version, :estimated_hours => 2.5) add_issue(version, :estimated_hours => 5) assert_equal 7.5, version.estimated_hours end test "#estimated_hours should return the sum of leaves estimated hours" do - version = Version.generate! + version = Version.create!(:project_id => 1, :name => 'test') parent = add_issue(version) add_issue(version, :estimated_hours => 2.5, :parent_issue_id => parent.id) add_issue(version, :estimated_hours => 5, :parent_issue_id => parent.id) |