summaryrefslogtreecommitdiffstats
path: root/test/functional/repositories_git_controller_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-01-09 09:53:50 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-01-09 09:53:50 +0000
commite4f72a8e3afb6027954e594f4866a222630a6860 (patch)
tree05b8886f2b5b138166bc8178846250ec263727cb /test/functional/repositories_git_controller_test.rb
parenta223a0dffdcae1ca6474b79775f3967a28cb9d5b (diff)
downloadredmine-e4f72a8e3afb6027954e594f4866a222630a6860.tar.gz
redmine-e4f72a8e3afb6027954e594f4866a222630a6860.zip
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
Diffstat (limited to 'test/functional/repositories_git_controller_test.rb')
-rw-r--r--test/functional/repositories_git_controller_test.rb27
1 files changed, 23 insertions, 4 deletions
diff --git a/test/functional/repositories_git_controller_test.rb b/test/functional/repositories_git_controller_test.rb
index da85da65c..f0c776082 100644
--- a/test/functional/repositories_git_controller_test.rb
+++ b/test/functional/repositories_git_controller_test.rb
@@ -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