scm: add compatible functional test fof changing diff revisions label at SCM adapter level.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4665 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-01-09 09:53:50 +00:00
parent a223a0dffd
commit e4f72a8e3a
2 changed files with 27 additions and 4 deletions

View File

@ -33,7 +33,8 @@ class RepositoriesGitControllerTest < ActionController::TestCase
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
User.current = nil
Repository::Git.create(:project => Project.find(3), :url => REPOSITORY_PATH)
@repository = Repository::Git.create(:project => Project.find(3), :url => REPOSITORY_PATH)
assert @repository
end
if File.directory?(REPOSITORY_PATH)
@ -128,6 +129,9 @@ class RepositoriesGitControllerTest < ActionController::TestCase
end
def test_diff
@repository.fetch_changesets
@repository.reload
# Full diff of changeset 2f9c0091
get :diff, :id => 3, :rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7'
assert_response :success
@ -138,6 +142,21 @@ class RepositoriesGitControllerTest < ActionController::TestCase
:sibling => { :tag => 'td',
:attributes => { :class => /diff_out/ },
:content => /def remove/ }
assert_tag :tag => 'h2', :content => /2f9c0091/
end
def test_diff_two_revs
@repository.fetch_changesets
@repository.reload
get :diff, :id => 3, :rev => '61b685fbe55ab05b5ac68402d5720c1a6ac973d1',
:rev_to => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7'
assert_response :success
assert_template 'diff'
diff = assigns(:diff)
assert_not_nil diff
assert_tag :tag => 'h2', :content => /2f9c0091:61b685fb/
end
def test_annotate

View File

@ -198,6 +198,8 @@ class RepositoriesSubversionControllerTest < ActionController::TestCase
get :diff, :id => 1, :rev => 3
assert_response :success
assert_template 'diff'
assert_tag :tag => 'h2', :content => /3/
end
def test_directory_diff
@ -209,6 +211,8 @@ class RepositoriesSubversionControllerTest < ActionController::TestCase
assert_not_nil diff
# 2 files modified
assert_equal 2, Redmine::UnifiedDiff.new(diff).size
assert_tag :tag => 'h2', :content => /2:6/
end
def test_annotate