summaryrefslogtreecommitdiffstats
path: root/test/unit/repository_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-15 18:19:19 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-15 18:19:19 +0000
commit1bd5e58c847816ae5751ee0026e55597d1541dd4 (patch)
treeb5c1be1f966f8b08986978713882856d014e363d /test/unit/repository_test.rb
parentd996cc0584901e7f44171093b170f882978124f7 (diff)
downloadredmine-1bd5e58c847816ae5751ee0026e55597d1541dd4.tar.gz
redmine-1bd5e58c847816ae5751ee0026e55597d1541dd4.zip
Adds support for multiple repositories per project (#779).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8650 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/repository_test.rb')
-rw-r--r--test/unit/repository_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/repository_test.rb b/test/unit/repository_test.rb
index ad0fc9f5f..275dc8bee 100644
--- a/test/unit/repository_test.rb
+++ b/test/unit/repository_test.rb
@@ -50,6 +50,19 @@ class RepositoryTest < ActiveSupport::TestCase
assert_equal repository, project.repository
end
+ def test_first_repository_should_be_set_as_default
+ repository1 = Repository::Subversion.new(:project => Project.find(3), :identifier => 'svn1', :url => 'file:///svn1')
+ assert repository1.save
+ assert repository1.is_default?
+
+ repository2 = Repository::Subversion.new(:project => Project.find(3), :identifier => 'svn2', :url => 'file:///svn2')
+ assert repository2.save
+ assert !repository2.is_default?
+
+ assert_equal repository1, Project.find(3).repository
+ assert_equal [repository1, repository2], Project.find(3).repositories.sort
+ end
+
def test_destroy
changesets = Changeset.count(:all, :conditions => "repository_id = 10")
changes = Change.count(:all, :conditions => "repository_id = 10",