summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/fixtures/repositories/bazaar_repository.tar.gzbin25056 -> 28862 bytes
-rw-r--r--test/functional/repositories_bazaar_controller_test.rb27
2 files changed, 25 insertions, 2 deletions
diff --git a/test/fixtures/repositories/bazaar_repository.tar.gz b/test/fixtures/repositories/bazaar_repository.tar.gz
index 084c84899..256358223 100644
--- a/test/fixtures/repositories/bazaar_repository.tar.gz
+++ b/test/fixtures/repositories/bazaar_repository.tar.gz
Binary files differ
diff --git a/test/functional/repositories_bazaar_controller_test.rb b/test/functional/repositories_bazaar_controller_test.rb
index 892a08fb8..46a71d231 100644
--- a/test/functional/repositories_bazaar_controller_test.rb
+++ b/test/functional/repositories_bazaar_controller_test.rb
@@ -23,7 +23,8 @@ class RepositoriesBazaarControllerTest < ActionController::TestCase
fixtures :projects, :users, :roles, :members, :member_roles,
:repositories, :enabled_modules
- REPOSITORY_PATH = Rails.root.join('tmp/test/bazaar_repository/trunk').to_s
+ REPOSITORY_PATH = Rails.root.join('tmp/test/bazaar_repository').to_s
+ REPOSITORY_PATH_TRUNK = File.join(REPOSITORY_PATH, "trunk")
PRJ_ID = 3
def setup
@@ -31,7 +32,7 @@ class RepositoriesBazaarControllerTest < ActionController::TestCase
@project = Project.find(PRJ_ID)
@repository = Repository::Bazaar.create(
:project => @project,
- :url => REPOSITORY_PATH,
+ :url => REPOSITORY_PATH_TRUNK,
:log_encoding => 'UTF-8')
assert @repository
end
@@ -148,6 +149,28 @@ class RepositoriesBazaarControllerTest < ActionController::TestCase
end
end
+ def test_annotate_author_escaping
+ repository = Repository::Bazaar.create(
+ :project => @project,
+ :url => File.join(REPOSITORY_PATH, "author_escaping"),
+ :identifier => 'author_escaping',
+ :log_encoding => 'UTF-8')
+ assert repository
+ get :annotate, :id => PRJ_ID, :repository_id => 'author_escaping',
+ :path => repository_path_hash(['author-escaping-test.txt'])[:param]
+ assert_response :success
+ assert_template 'annotate'
+ assert_select "th.line-num", :text => '1' do
+ assert_select "+ td.revision" do
+ assert_select "a", :text => '2'
+ assert_select "+ td.author", :text => "test &amp;" do
+ assert_select "+ td",
+ :text => "author escaping test"
+ end
+ end
+ end
+ end
+
def test_destroy_valid_repository
@request.session[:user_id] = 1 # admin
assert_equal 0, @repository.changesets.count