@@ -20,6 +20,8 require File.expand_path('../../test_helper', __FILE__) | |||
|
20 | 20 | class RepositoryDarcsTest < ActiveSupport::TestCase |
|
21 | 21 | fixtures :projects |
|
22 | 22 | |
|
23 | include Redmine::I18n | |
|
24 | ||
|
23 | 25 | REPOSITORY_PATH = Rails.root.join('tmp/test/darcs_repository').to_s |
|
24 | 26 | NUM_REV = 6 |
|
25 | 27 | |
@@ -33,6 +35,32 class RepositoryDarcsTest < ActiveSupport::TestCase | |||
|
33 | 35 | assert @repository |
|
34 | 36 | end |
|
35 | 37 | |
|
38 | def test_blank_path_to_repository_error_message | |
|
39 | set_language_if_valid 'en' | |
|
40 | repo = Repository::Darcs.new( | |
|
41 | :project => @project, | |
|
42 | :identifier => 'test', | |
|
43 | :log_encoding => 'UTF-8' | |
|
44 | ) | |
|
45 | assert !repo.save | |
|
46 | assert_include "Path to repository can't be blank", | |
|
47 | repo.errors.full_messages | |
|
48 | end | |
|
49 | ||
|
50 | def test_blank_path_to_repository_error_message_fr | |
|
51 | set_language_if_valid 'fr' | |
|
52 | str = "Chemin du d\xc3\xa9p\xc3\xb4t doit \xc3\xaatre renseign\xc3\xa9(e)" | |
|
53 | str.force_encoding('UTF-8') if str.respond_to?(:force_encoding) | |
|
54 | repo = Repository::Darcs.new( | |
|
55 | :project => @project, | |
|
56 | :url => "", | |
|
57 | :identifier => 'test', | |
|
58 | :log_encoding => 'UTF-8' | |
|
59 | ) | |
|
60 | assert !repo.save | |
|
61 | assert_include str, repo.errors.full_messages | |
|
62 | end | |
|
63 | ||
|
36 | 64 | if File.directory?(REPOSITORY_PATH) |
|
37 | 65 | def test_fetch_changesets_from_scratch |
|
38 | 66 | assert_equal 0, @repository.changesets.count |
General Comments 0
You need to be logged in to leave comments.
Login now