diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-02-24 04:08:47 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-02-24 04:08:47 +0000 |
commit | c0cdde65065e8dc23c4967e4962d2e35b97f2e6e (patch) | |
tree | 46ca44691a3a758caa4236fa01db59565c9014c4 | |
parent | 34d14500c95713d25bbb0cc170aa0247aca5e8ad (diff) | |
download | redmine-c0cdde65065e8dc23c4967e4962d2e35b97f2e6e.tar.gz redmine-c0cdde65065e8dc23c4967e4962d2e35b97f2e6e.zip |
scm: add test to override human_attribute_name of log_encoding
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8957 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | test/unit/repository_test.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/unit/repository_test.rb b/test/unit/repository_test.rb index 51a5c229d..04f788117 100644 --- a/test/unit/repository_test.rb +++ b/test/unit/repository_test.rb @@ -34,10 +34,36 @@ class RepositoryTest < ActiveSupport::TestCase :roles, :enumerations + include Redmine::I18n + def setup @repository = Project.find(1).repository end + def test_blank_log_encoding_error_message + set_language_if_valid 'en' + repo = Repository::Bazaar.new( + :project => Project.find(3), + :url => "/test", + :log_encoding => '' + ) + assert !repo.save + assert_include "Commit messages encoding can't be blank", + repo.errors.full_messages + end + + def test_blank_log_encoding_error_message_fr + set_language_if_valid 'fr' + str = "Encodage des messages de commit doit \xc3\xaatre renseign\xc3\xa9(e)" + str.force_encoding('UTF-8') if str.respond_to?(:force_encoding) + repo = Repository::Bazaar.new( + :project => Project.find(3), + :url => "/test" + ) + assert !repo.save + assert_include str, repo.errors.full_messages + end + def test_create repository = Repository::Subversion.new(:project => Project.find(3)) assert !repository.save |