scm: mercurial: diff '-c' option supports above Mercurial 1.2 (#3724, #7253).

r4662 fails in old Mercurial.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4686 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2011-01-11 05:15:56 +00:00
parent 35b9972c81
commit a6f05b5e56
3 changed files with 28 additions and 14 deletions
@@ -32,9 +32,10 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
User.current = nil
Repository::Mercurial.create(:project => Project.find(3), :url => REPOSITORY_PATH)
@repository = Repository::Mercurial.create(:project => Project.find(3), :url => REPOSITORY_PATH)
assert @repository
end
if File.directory?(REPOSITORY_PATH)
def test_show
get :show, :id => 3
@@ -132,12 +133,15 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
get :diff, :id => 3, :rev => 4
assert_response :success
assert_template 'diff'
# Line 22 removed
assert_tag :tag => 'th',
:content => '22',
:sibling => { :tag => 'td',
:attributes => { :class => /diff_out/ },
:content => /def remove/ }
if @repository.scm.class.client_version_above?([1, 2])
# Line 22 removed
assert_tag :tag => 'th',
:content => '22',
:sibling => { :tag => 'td',
:attributes => { :class => /diff_out/ },
:content => /def remove/ }
end
end
end