summaryrefslogtreecommitdiffstats
path: root/test/unit/repository_mercurial_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-02-24 11:31:59 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-02-24 11:31:59 +0000
commitbeb3b23fb63b4b796cc1633b9fe45c4beae9682f (patch)
tree2262da0c7a15263b901879b5827e4544d4db7a47 /test/unit/repository_mercurial_test.rb
parentca9e41280ab0de1c2782c894db0eee78afa5d933 (diff)
downloadredmine-beb3b23fb63b4b796cc1633b9fe45c4beae9682f.tar.gz
redmine-beb3b23fb63b4b796cc1633b9fe45c4beae9682f.zip
scm: mercurial: add test to override human_attribute_name of "path to repository"
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8964 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/repository_mercurial_test.rb')
-rw-r--r--test/unit/repository_mercurial_test.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/unit/repository_mercurial_test.rb b/test/unit/repository_mercurial_test.rb
index d4348e377..f5206e3f9 100644
--- a/test/unit/repository_mercurial_test.rb
+++ b/test/unit/repository_mercurial_test.rb
@@ -20,6 +20,8 @@ require File.expand_path('../../test_helper', __FILE__)
class RepositoryMercurialTest < ActiveSupport::TestCase
fixtures :projects
+ include Redmine::I18n
+
REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s
NUM_REV = 32
CHAR_1_HEX = "\xc3\x9c"
@@ -44,6 +46,33 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
end
end
+
+ def test_blank_path_to_repository_error_message
+ set_language_if_valid 'en'
+ repo = Repository::Mercurial.new(
+ :project => @project,
+ :identifier => 'test',
+ :log_encoding => 'UTF-8'
+ )
+ assert !repo.save
+ assert_include "Path to repository can't be blank",
+ repo.errors.full_messages
+ end
+
+ def test_blank_path_to_repository_error_message_fr
+ set_language_if_valid 'fr'
+ str = "Chemin du d\xc3\xa9p\xc3\xb4t doit \xc3\xaatre renseign\xc3\xa9(e)"
+ str.force_encoding('UTF-8') if str.respond_to?(:force_encoding)
+ repo = Repository::Mercurial.new(
+ :project => @project,
+ :url => "",
+ :identifier => 'test',
+ :log_encoding => 'UTF-8'
+ )
+ assert !repo.save
+ assert_include str, repo.errors.full_messages
+ end
+
if File.directory?(REPOSITORY_PATH)
def test_scm_available
klass = Repository::Mercurial