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
This commit is contained in:
Toshi MARUYAMA 2012-02-24 04:08:47 +00:00
parent 34d14500c9
commit c0cdde6506
1 changed files with 26 additions and 0 deletions

View File

@ -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