##// END OF EJS Templates
code layout clean up VersionTest...
Toshi MARUYAMA -
r11651:eeeada0773de
parent child
Show More
@@ -18,17 +18,20
18 require File.expand_path('../../test_helper', __FILE__)
18 require File.expand_path('../../test_helper', __FILE__)
19
19
20 class VersionTest < ActiveSupport::TestCase
20 class VersionTest < ActiveSupport::TestCase
21 fixtures :projects, :users, :issues, :issue_statuses, :trackers, :enumerations, :versions, :projects_trackers
21 fixtures :projects, :users, :issues, :issue_statuses, :trackers,
22 :enumerations, :versions, :projects_trackers
22
23
23 def test_create
24 def test_create
24 v = Version.new(:project => Project.find(1), :name => '1.1', :effective_date => '2011-03-25')
25 v = Version.new(:project => Project.find(1), :name => '1.1',
26 :effective_date => '2011-03-25')
25 assert v.save
27 assert v.save
26 assert_equal 'open', v.status
28 assert_equal 'open', v.status
27 assert_equal 'none', v.sharing
29 assert_equal 'none', v.sharing
28 end
30 end
29
31
30 def test_invalid_effective_date_validation
32 def test_invalid_effective_date_validation
31 v = Version.new(:project => Project.find(1), :name => '1.1', :effective_date => '99999-01-01')
33 v = Version.new(:project => Project.find(1), :name => '1.1',
34 :effective_date => '99999-01-01')
32 assert !v.valid?
35 assert !v.valid?
33 v.effective_date = '2012-11-33'
36 v.effective_date = '2012-11-33'
34 assert !v.valid?
37 assert !v.valid?
@@ -213,11 +216,13 class VersionTest < ActiveSupport::TestCase
213
216
214 # Project 1 now out of the shared scope
217 # Project 1 now out of the shared scope
215 project_1_issue.reload
218 project_1_issue.reload
216 assert_equal nil, project_1_issue.fixed_version, "Fixed version is still set after changing the Version's sharing"
219 assert_equal nil, project_1_issue.fixed_version,
220 "Fixed version is still set after changing the Version's sharing"
217
221
218 # Project 5 now out of the shared scope
222 # Project 5 now out of the shared scope
219 project_5_issue.reload
223 project_5_issue.reload
220 assert_equal nil, project_5_issue.fixed_version, "Fixed version is still set after changing the Version's sharing"
224 assert_equal nil, project_5_issue.fixed_version,
225 "Fixed version is still set after changing the Version's sharing"
221
226
222 # Project 2 issue remains
227 # Project 2 issue remains
223 project_2_issue.reload
228 project_2_issue.reload
General Comments 0
You need to be logged in to leave comments. Login now