summaryrefslogtreecommitdiffstats
path: root/test/functional/repositories_subversion_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-09-01 12:13:17 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-09-01 12:13:17 +0000
commit5b975706932d269a0eceee924558f428bf1cd16c (patch)
tree6e57b1c0989ce3bd5be00eb54ed29c386108e499 /test/functional/repositories_subversion_controller_test.rb
parent71abeb5898f1ee1be88fb3071c2d7e5ea8e8028b (diff)
downloadredmine-5b975706932d269a0eceee924558f428bf1cd16c.tar.gz
redmine-5b975706932d269a0eceee924558f428bf1cd16c.zip
SCM:
* add latest changesets for the current directory when browsing the repository and a link to the full log * ability to diff a directory (#3575) git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2849 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/repositories_subversion_controller_test.rb')
-rw-r--r--test/functional/repositories_subversion_controller_test.rb25
1 files changed, 23 insertions, 2 deletions
diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb
index 8e4affade..fe1b3dbe5 100644
--- a/test/functional/repositories_subversion_controller_test.rb
+++ b/test/functional/repositories_subversion_controller_test.rb
@@ -75,7 +75,7 @@ class RepositoriesSubversionControllerTest < Test::Unit::TestCase
assert_equal ['folder', '.project', 'helloworld.c', 'helloworld.rb', 'textfile.txt'], assigns(:entries).collect(&:name)
end
- def test_changes
+ def test_file_changes
get :changes, :id => 1, :path => ['subversion_test', 'folder', 'helloworld.rb' ]
assert_response :success
assert_template 'changes'
@@ -94,6 +94,16 @@ class RepositoriesSubversionControllerTest < Test::Unit::TestCase
:child => { :tag => 'span', :content => 'native' } }
end
end
+
+ def test_directory_changes
+ get :changes, :id => 1, :path => ['subversion_test', 'folder' ]
+ assert_response :success
+ assert_template 'changes'
+
+ changesets = assigns(:changesets)
+ assert_not_nil changesets
+ assert_equal %w(7 6 5 2), changesets.collect(&:revision)
+ end
def test_entry
get :entry, :id => 1, :path => ['subversion_test', 'helloworld.c']
@@ -181,11 +191,22 @@ class RepositoriesSubversionControllerTest < Test::Unit::TestCase
}
end
- def test_diff
+ def test_revision_diff
get :diff, :id => 1, :rev => 3
assert_response :success
assert_template 'diff'
end
+
+ def test_directory_diff
+ get :diff, :id => 1, :rev => 6, :rev_to => 2, :path => ['subversion_test', 'folder']
+ assert_response :success
+ assert_template 'diff'
+
+ diff = assigns(:diff)
+ assert_not_nil diff
+ # 2 files modified
+ assert_equal 2, Redmine::UnifiedDiff.new(diff).size
+ end
def test_annotate
get :annotate, :id => 1, :path => ['subversion_test', 'helloworld.c']