code layout clean up VersionTest
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11881 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
bbca694881
commit
eeeada0773
@ -18,17 +18,20 @@
|
|||||||
require File.expand_path('../../test_helper', __FILE__)
|
require File.expand_path('../../test_helper', __FILE__)
|
||||||
|
|
||||||
class VersionTest < ActiveSupport::TestCase
|
class VersionTest < ActiveSupport::TestCase
|
||||||
fixtures :projects, :users, :issues, :issue_statuses, :trackers, :enumerations, :versions, :projects_trackers
|
fixtures :projects, :users, :issues, :issue_statuses, :trackers,
|
||||||
|
:enumerations, :versions, :projects_trackers
|
||||||
|
|
||||||
def test_create
|
def test_create
|
||||||
v = Version.new(:project => Project.find(1), :name => '1.1', :effective_date => '2011-03-25')
|
v = Version.new(:project => Project.find(1), :name => '1.1',
|
||||||
|
:effective_date => '2011-03-25')
|
||||||
assert v.save
|
assert v.save
|
||||||
assert_equal 'open', v.status
|
assert_equal 'open', v.status
|
||||||
assert_equal 'none', v.sharing
|
assert_equal 'none', v.sharing
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_invalid_effective_date_validation
|
def test_invalid_effective_date_validation
|
||||||
v = Version.new(:project => Project.find(1), :name => '1.1', :effective_date => '99999-01-01')
|
v = Version.new(:project => Project.find(1), :name => '1.1',
|
||||||
|
:effective_date => '99999-01-01')
|
||||||
assert !v.valid?
|
assert !v.valid?
|
||||||
v.effective_date = '2012-11-33'
|
v.effective_date = '2012-11-33'
|
||||||
assert !v.valid?
|
assert !v.valid?
|
||||||
@ -213,11 +216,13 @@ class VersionTest < ActiveSupport::TestCase
|
|||||||
|
|
||||||
# Project 1 now out of the shared scope
|
# Project 1 now out of the shared scope
|
||||||
project_1_issue.reload
|
project_1_issue.reload
|
||||||
assert_equal nil, project_1_issue.fixed_version, "Fixed version is still set after changing the Version's sharing"
|
assert_equal nil, project_1_issue.fixed_version,
|
||||||
|
"Fixed version is still set after changing the Version's sharing"
|
||||||
|
|
||||||
# Project 5 now out of the shared scope
|
# Project 5 now out of the shared scope
|
||||||
project_5_issue.reload
|
project_5_issue.reload
|
||||||
assert_equal nil, project_5_issue.fixed_version, "Fixed version is still set after changing the Version's sharing"
|
assert_equal nil, project_5_issue.fixed_version,
|
||||||
|
"Fixed version is still set after changing the Version's sharing"
|
||||||
|
|
||||||
# Project 2 issue remains
|
# Project 2 issue remains
|
||||||
project_2_issue.reload
|
project_2_issue.reload
|
||||||
|
Loading…
x
Reference in New Issue
Block a user