@@ -20,6 +20,8 require File.expand_path('../../test_helper', __FILE__) | |||
|
20 | 20 | class RepositoryFilesystemTest < ActiveSupport::TestCase |
|
21 | 21 | fixtures :projects |
|
22 | 22 | |
|
23 | include Redmine::I18n | |
|
24 | ||
|
23 | 25 | REPOSITORY_PATH = Rails.root.join('tmp/test/filesystem_repository').to_s |
|
24 | 26 | |
|
25 | 27 | def setup |
@@ -32,6 +34,31 class RepositoryFilesystemTest < ActiveSupport::TestCase | |||
|
32 | 34 | assert @repository |
|
33 | 35 | end |
|
34 | 36 | |
|
37 | def test_blank_root_directory_error_message | |
|
38 | set_language_if_valid 'en' | |
|
39 | repo = Repository::Filesystem.new( | |
|
40 | :project => @project, | |
|
41 | :identifier => 'test' | |
|
42 | ) | |
|
43 | assert !repo.save | |
|
44 | assert_include "Root directory can't be blank", | |
|
45 | repo.errors.full_messages | |
|
46 | end | |
|
47 | ||
|
48 | def test_blank_root_directory_error_message_fr | |
|
49 | set_language_if_valid 'fr' | |
|
50 | str = "R\xc3\xa9pertoire racine doit \xc3\xaatre renseign\xc3\xa9(e)" | |
|
51 | str.force_encoding('UTF-8') if str.respond_to?(:force_encoding) | |
|
52 | repo = Repository::Filesystem.new( | |
|
53 | :project => @project, | |
|
54 | :url => "", | |
|
55 | :identifier => 'test', | |
|
56 | :path_encoding => '' | |
|
57 | ) | |
|
58 | assert !repo.save | |
|
59 | assert_include str, repo.errors.full_messages | |
|
60 | end | |
|
61 | ||
|
35 | 62 | if File.directory?(REPOSITORY_PATH) |
|
36 | 63 | def test_fetch_changesets |
|
37 | 64 | assert_equal 0, @repository.changesets.count |
General Comments 0
You need to be logged in to leave comments.
Login now