diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-02-24 10:01:58 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-02-24 10:01:58 +0000 |
commit | b73d5d7ecc1796231e67a8c6f21a466a70892a0d (patch) | |
tree | 7bb556f1cf0e45dbd10bfc5d266b6a013915c5dc /test/unit/repository_darcs_test.rb | |
parent | 873e57dc86610e35f349f1f988f601f5214e90f5 (diff) | |
download | redmine-b73d5d7ecc1796231e67a8c6f21a466a70892a0d.tar.gz redmine-b73d5d7ecc1796231e67a8c6f21a466a70892a0d.zip |
scm: darcs: add test to override human_attribute_name of "path to repository"
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8959 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/repository_darcs_test.rb')
-rw-r--r-- | test/unit/repository_darcs_test.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/unit/repository_darcs_test.rb b/test/unit/repository_darcs_test.rb index 72e45bf1f..edbf541cd 100644 --- a/test/unit/repository_darcs_test.rb +++ b/test/unit/repository_darcs_test.rb @@ -20,6 +20,8 @@ require File.expand_path('../../test_helper', __FILE__) class RepositoryDarcsTest < ActiveSupport::TestCase fixtures :projects + include Redmine::I18n + REPOSITORY_PATH = Rails.root.join('tmp/test/darcs_repository').to_s NUM_REV = 6 @@ -33,6 +35,32 @@ class RepositoryDarcsTest < ActiveSupport::TestCase assert @repository end + def test_blank_path_to_repository_error_message + set_language_if_valid 'en' + repo = Repository::Darcs.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::Darcs.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_fetch_changesets_from_scratch assert_equal 0, @repository.changesets.count |