@@ -20,6 +20,8 require File.expand_path('../../test_helper', __FILE__) | |||
|
20 | 20 | class RepositoryMercurialTest < ActiveSupport::TestCase |
|
21 | 21 | fixtures :projects |
|
22 | 22 | |
|
23 | include Redmine::I18n | |
|
24 | ||
|
23 | 25 | REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s |
|
24 | 26 | NUM_REV = 32 |
|
25 | 27 | CHAR_1_HEX = "\xc3\x9c" |
@@ -44,6 +46,33 class RepositoryMercurialTest < ActiveSupport::TestCase | |||
|
44 | 46 | end |
|
45 | 47 | end |
|
46 | 48 | |
|
49 | ||
|
50 | def test_blank_path_to_repository_error_message | |
|
51 | set_language_if_valid 'en' | |
|
52 | repo = Repository::Mercurial.new( | |
|
53 | :project => @project, | |
|
54 | :identifier => 'test', | |
|
55 | :log_encoding => 'UTF-8' | |
|
56 | ) | |
|
57 | assert !repo.save | |
|
58 | assert_include "Path to repository can't be blank", | |
|
59 | repo.errors.full_messages | |
|
60 | end | |
|
61 | ||
|
62 | def test_blank_path_to_repository_error_message_fr | |
|
63 | set_language_if_valid 'fr' | |
|
64 | str = "Chemin du d\xc3\xa9p\xc3\xb4t doit \xc3\xaatre renseign\xc3\xa9(e)" | |
|
65 | str.force_encoding('UTF-8') if str.respond_to?(:force_encoding) | |
|
66 | repo = Repository::Mercurial.new( | |
|
67 | :project => @project, | |
|
68 | :url => "", | |
|
69 | :identifier => 'test', | |
|
70 | :log_encoding => 'UTF-8' | |
|
71 | ) | |
|
72 | assert !repo.save | |
|
73 | assert_include str, repo.errors.full_messages | |
|
74 | end | |
|
75 | ||
|
47 | 76 | if File.directory?(REPOSITORY_PATH) |
|
48 | 77 | def test_scm_available |
|
49 | 78 | klass = Repository::Mercurial |
General Comments 0
You need to be logged in to leave comments.
Login now