@@ -20,6 +20,8 require File.expand_path('../../test_helper', __FILE__) | |||||
20 | class RepositorySubversionTest < ActiveSupport::TestCase |
|
20 | class RepositorySubversionTest < ActiveSupport::TestCase | |
21 | fixtures :projects, :repositories, :enabled_modules, :users, :roles |
|
21 | fixtures :projects, :repositories, :enabled_modules, :users, :roles | |
22 |
|
22 | |||
|
23 | include Redmine::I18n | |||
|
24 | ||||
23 | NUM_REV = 11 |
|
25 | NUM_REV = 11 | |
24 |
|
26 | |||
25 | def setup |
|
27 | def setup | |
@@ -29,6 +31,32 class RepositorySubversionTest < ActiveSupport::TestCase | |||||
29 | assert @repository |
|
31 | assert @repository | |
30 | end |
|
32 | end | |
31 |
|
33 | |||
|
34 | def test_invalid_url | |||
|
35 | set_language_if_valid 'en' | |||
|
36 | ['invalid', 'http://', 'svn://', 'svn+ssh://', 'file://'].each do |url| | |||
|
37 | repo = Repository::Subversion.new( | |||
|
38 | :project => @project, | |||
|
39 | :identifier => 'test', | |||
|
40 | :url => url | |||
|
41 | ) | |||
|
42 | assert !repo.save | |||
|
43 | assert_include "is invalid", repo.errors[:url] | |||
|
44 | end | |||
|
45 | end | |||
|
46 | ||||
|
47 | def test_valid_url | |||
|
48 | ['http://valid', 'svn://valid', 'svn+ssh://valid', 'file://valid'].each do |url| | |||
|
49 | repo = Repository::Subversion.new( | |||
|
50 | :project => @project, | |||
|
51 | :identifier => 'test', | |||
|
52 | :url => url | |||
|
53 | ) | |||
|
54 | assert repo.save | |||
|
55 | assert_equal [], repo.errors[:url] | |||
|
56 | assert repo.destroy | |||
|
57 | end | |||
|
58 | end | |||
|
59 | ||||
32 | if repository_configured?('subversion') |
|
60 | if repository_configured?('subversion') | |
33 | def test_fetch_changesets_from_scratch |
|
61 | def test_fetch_changesets_from_scratch | |
34 | assert_equal 0, @repository.changesets.count |
|
62 | assert_equal 0, @repository.changesets.count |
General Comments 0
You need to be logged in to leave comments.
Login now