@@ -20,6 +20,8 require File.expand_path('../../test_helper', __FILE__) | |||
|
20 | 20 | class RepositoryGitTest < ActiveSupport::TestCase |
|
21 | 21 | fixtures :projects, :repositories, :enabled_modules, :users, :roles |
|
22 | 22 | |
|
23 | include Redmine::I18n | |
|
24 | ||
|
23 | 25 | REPOSITORY_PATH = Rails.root.join('tmp/test/git_repository').to_s |
|
24 | 26 | REPOSITORY_PATH.gsub!(/\//, "\\") if Redmine::Platform.mswin? |
|
25 | 27 | |
@@ -57,6 +59,32 class RepositoryGitTest < ActiveSupport::TestCase | |||
|
57 | 59 | end |
|
58 | 60 | end |
|
59 | 61 | |
|
62 | def test_blank_path_to_repository_error_message | |
|
63 | set_language_if_valid 'en' | |
|
64 | repo = Repository::Git.new( | |
|
65 | :project => @project, | |
|
66 | :identifier => 'test', | |
|
67 | :log_encoding => 'UTF-8' | |
|
68 | ) | |
|
69 | assert !repo.save | |
|
70 | assert_include "Path to repository can't be blank", | |
|
71 | repo.errors.full_messages | |
|
72 | end | |
|
73 | ||
|
74 | def test_blank_path_to_repository_error_message_fr | |
|
75 | set_language_if_valid 'fr' | |
|
76 | str = "Chemin du d\xc3\xa9p\xc3\xb4t doit \xc3\xaatre renseign\xc3\xa9(e)" | |
|
77 | str.force_encoding('UTF-8') if str.respond_to?(:force_encoding) | |
|
78 | repo = Repository::Git.new( | |
|
79 | :project => @project, | |
|
80 | :url => "", | |
|
81 | :identifier => 'test', | |
|
82 | :log_encoding => 'UTF-8' | |
|
83 | ) | |
|
84 | assert !repo.save | |
|
85 | assert_include str, repo.errors.full_messages | |
|
86 | end | |
|
87 | ||
|
60 | 88 | if File.directory?(REPOSITORY_PATH) |
|
61 | 89 | def test_scm_available |
|
62 | 90 | klass = Repository::Git |
General Comments 0
You need to be logged in to leave comments.
Login now