diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/repository_subversion_test.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/unit/repository_subversion_test.rb b/test/unit/repository_subversion_test.rb index 9e9cdac9d..674083fdc 100644 --- a/test/unit/repository_subversion_test.rb +++ b/test/unit/repository_subversion_test.rb @@ -20,6 +20,8 @@ require File.expand_path('../../test_helper', __FILE__) class RepositorySubversionTest < ActiveSupport::TestCase fixtures :projects, :repositories, :enabled_modules, :users, :roles + include Redmine::I18n + NUM_REV = 11 def setup @@ -29,6 +31,32 @@ class RepositorySubversionTest < ActiveSupport::TestCase assert @repository end + def test_invalid_url + set_language_if_valid 'en' + ['invalid', 'http://', 'svn://', 'svn+ssh://', 'file://'].each do |url| + repo = Repository::Subversion.new( + :project => @project, + :identifier => 'test', + :url => url + ) + assert !repo.save + assert_include "is invalid", repo.errors[:url] + end + end + + def test_valid_url + ['http://valid', 'svn://valid', 'svn+ssh://valid', 'file://valid'].each do |url| + repo = Repository::Subversion.new( + :project => @project, + :identifier => 'test', + :url => url + ) + assert repo.save + assert_equal [], repo.errors[:url] + assert repo.destroy + end + end + if repository_configured?('subversion') def test_fetch_changesets_from_scratch assert_equal 0, @repository.changesets.count |