summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-08-31 12:59:57 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-08-31 12:59:57 +0000
commitdbad26c87db8247c0d635c993981d4277e165978 (patch)
tree331b8029e1f6c02c5812033b7080281a6a0fbc60 /test
parent25b4139028696d4f4fb057f598a771aca52b7afe (diff)
downloadredmine-dbad26c87db8247c0d635c993981d4277e165978.tar.gz
redmine-dbad26c87db8247c0d635c993981d4277e165978.zip
Adds an option to generate sequential project identifiers.
Disabled by default, it can be enabled on the 'Projects' tab in application settings. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1777 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/project_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb
index 91fab8208..6e32c02e7 100644
--- a/test/unit/project_test.rb
+++ b/test/unit/project_test.rb
@@ -130,4 +130,15 @@ class ProjectTest < Test::Unit::TestCase
assert_equal [1, 2, 3], parent.rolled_up_trackers.collect(&:id)
assert_equal [2, 3], child.rolled_up_trackers.collect(&:id)
end
+
+ def test_next_identifier
+ ProjectCustomField.delete_all
+ Project.create!(:name => 'last', :identifier => 'p2008040')
+ assert_equal 'p2008041', Project.next_identifier
+ end
+
+ def test_next_identifier_first_project
+ Project.delete_all
+ assert_nil Project.next_identifier
+ end
end