summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-01-21 13:22:28 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-01-21 13:22:28 +0000
commitccdea234ad655fab8125e34c0bbad7d27accc886 (patch)
tree9cb4c48f41f0d63d3dc9ac44c1be362676cd38fb
parent6e1fa1603b16da3e9792e26b3bca5d1618ca24dc (diff)
downloadredmine-ccdea234ad655fab8125e34c0bbad7d27accc886.tar.gz
redmine-ccdea234ad655fab8125e34c0bbad7d27accc886.zip
scm: functional test of using format_revision() for annotate (#3724).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4734 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/functional/repositories_git_controller_test.rb9
-rw-r--r--test/functional/repositories_mercurial_controller_test.rb11
-rw-r--r--test/functional/repositories_subversion_controller_test.rb7
3 files changed, 27 insertions, 0 deletions
diff --git a/test/functional/repositories_git_controller_test.rb b/test/functional/repositories_git_controller_test.rb
index cbe0dc1a2..86d6035fb 100644
--- a/test/functional/repositories_git_controller_test.rb
+++ b/test/functional/repositories_git_controller_test.rb
@@ -170,6 +170,15 @@ class RepositoriesGitControllerTest < ActionController::TestCase
:sibling => { :tag => 'td', :content => /watcher =/ }
end
+ def test_annotate_at_given_revision
+ @repository.fetch_changesets
+ @repository.reload
+ get :annotate, :id => 3, :rev => 'deff7', :path => ['sources', 'watchers_controller.rb']
+ assert_response :success
+ assert_template 'annotate'
+ assert_tag :tag => 'h2', :content => /@ deff712f/
+ end
+
def test_annotate_binary_file
get :annotate, :id => 3, :path => ['images', 'edit.png']
assert_response 500
diff --git a/test/functional/repositories_mercurial_controller_test.rb b/test/functional/repositories_mercurial_controller_test.rb
index d48c7909e..ae7f4226e 100644
--- a/test/functional/repositories_mercurial_controller_test.rb
+++ b/test/functional/repositories_mercurial_controller_test.rb
@@ -196,6 +196,17 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
:sibling => { :tag => 'td', :content => /watcher =/ }
end
+ def test_annotate_at_given_revision
+ @repository.fetch_changesets
+ @repository.reload
+ [2, '400bb8672109', '400', 400].each do |r1|
+ get :annotate, :id => 3, :rev => r1, :path => ['sources', 'watchers_controller.rb']
+ assert_response :success
+ assert_template 'annotate'
+ assert_tag :tag => 'h2', :content => /@ 2:400bb8672109/
+ end
+ end
+
def test_empty_revision
@repository.fetch_changesets
@repository.reload
diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb
index 1a13797d8..be2b6087d 100644
--- a/test/functional/repositories_subversion_controller_test.rb
+++ b/test/functional/repositories_subversion_controller_test.rb
@@ -228,6 +228,13 @@ class RepositoriesSubversionControllerTest < ActionController::TestCase
assert_response :success
assert_template 'annotate'
end
+
+ def test_annotate_at_given_revision
+ get :annotate, :id => 1, :rev => 8, :path => ['subversion_test', 'helloworld.c']
+ assert_response :success
+ assert_template 'annotate'
+ assert_tag :tag => 'h2', :content => /@ 8/
+ end
else
puts "Subversion test repository NOT FOUND. Skipping functional tests !!!"
def test_fake; assert true end