diff options
-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 |