Commit 4c199b13 authored by tmaruyama's avatar tmaruyama

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

git-svn-id: https://svn.redmine.org/redmine/trunk@4665 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 272bd428
......@@ -33,9 +33,10 @@ 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)
def test_show
get :show, :id => 3
......@@ -126,8 +127,11 @@ class RepositoriesGitControllerTest < ActionController::TestCase
assert_not_nil assigns(:entry)
assert_equal 'sources', assigns(:entry).name
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
......@@ -150,7 +169,7 @@ class RepositoriesGitControllerTest < ActionController::TestCase
:sibling => { :tag => 'td', :content => /jsmith/ },
:sibling => { :tag => 'td', :content => /watcher =/ }
end
def test_annotate_binary_file
get :annotate, :id => 3, :path => ['images', 'edit.png']
assert_response 500
......
......@@ -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
......
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