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