diff test/functional/repositories_subversion_controller_test.rb @ 119:8661b858af72

* Update to Redmine trunk rev 4705
author Chris Cannam
date Thu, 13 Jan 2011 14:12:06 +0000
parents 94944d00e43c
children 07fa8a8b56a8
line wrap: on
line diff
--- a/test/functional/repositories_subversion_controller_test.rb	Fri Nov 19 14:05:24 2010 +0000
+++ b/test/functional/repositories_subversion_controller_test.rb	Thu Jan 13 14:12:06 2011 +0000
@@ -15,7 +15,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
-require File.dirname(__FILE__) + '/../test_helper'
+require File.expand_path('../../test_helper', __FILE__)
 require 'repositories_controller'
 
 # Re-raise errors caught by the controller.
@@ -166,6 +166,20 @@
                             }
     end
     
+    def test_invalid_revision
+      get :revision, :id => 1, :rev => 'something_weird'
+      assert_response 500
+      assert_error_tag :content => /was not found/
+    end
+
+    def test_empty_revision
+      ['', ' ', nil].each do |r|
+        get :revision, :id => 1, :rev => r
+        assert_response 500
+        assert_error_tag :content => /was not found/
+      end
+    end
+
     def test_revision_with_repository_pointing_to_a_subdirectory
       r = Project.find(1).repository
       # Changes repository url to a subdirectory
@@ -192,6 +206,8 @@
       get :diff, :id => 1, :rev => 3
       assert_response :success
       assert_template 'diff'
+
+      assert_tag :tag => 'h2', :content => /3/
     end
 
     def test_directory_diff
@@ -203,6 +219,8 @@
       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