Commit a223a0df authored by Toshi MARUYAMA's avatar Toshi MARUYAMA

scm: mercurial: functional test for accept both of revision number and changeset id (#3724).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4664 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent ef28bf6d
...@@ -68,15 +68,18 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase ...@@ -68,15 +68,18 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
end end
def test_show_at_given_revision def test_show_at_given_revision
get :show, :id => 3, :path => ['images'], :rev => 0 [0, '0', '0885933ad4f6'].each do |r1|
get :show, :id => 3, :path => ['images'], :rev => r1
assert_response :success assert_response :success
assert_template 'show' assert_template 'show'
assert_not_nil assigns(:entries) assert_not_nil assigns(:entries)
assert_equal ['delete.png'], assigns(:entries).collect(&:name) assert_equal ['delete.png'], assigns(:entries).collect(&:name)
end end
end
def test_show_directory_sql_escape_percent def test_show_directory_sql_escape_percent
get :show, :id => 3, :path => ['sql_escape', 'percent%dir'], :rev => 13 [13, '13', '3a330eb32958'].each do |r1|
get :show, :id => 3, :path => ['sql_escape', 'percent%dir'], :rev => r1
assert_response :success assert_response :success
assert_template 'show' assert_template 'show'
...@@ -88,6 +91,7 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase ...@@ -88,6 +91,7 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
# assert_not_nil changesets # assert_not_nil changesets
# assert_equal %w(13 11 10 9), changesets.collect(&:revision) # assert_equal %w(13 11 10 9), changesets.collect(&:revision)
end end
end
def test_changes def test_changes
get :changes, :id => 3, :path => ['images', 'edit.png'] get :changes, :id => 3, :path => ['images', 'edit.png']
...@@ -123,6 +127,7 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase ...@@ -123,6 +127,7 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
end end
def test_diff def test_diff
[4, '4', 'def6d2f1254a'].each do |r1|
# Full diff of changeset 4 # Full diff of changeset 4
get :diff, :id => 3, :rev => 4 get :diff, :id => 3, :rev => 4
assert_response :success assert_response :success
...@@ -134,6 +139,7 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase ...@@ -134,6 +139,7 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
:attributes => { :class => /diff_out/ }, :attributes => { :class => /diff_out/ },
:content => /def remove/ } :content => /def remove/ }
end end
end
def test_annotate def test_annotate
get :annotate, :id => 3, :path => ['sources', 'watchers_controller.rb'] get :annotate, :id => 3, :path => ['sources', 'watchers_controller.rb']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment