Merged r1307 to r1369 from trunk.

git-svn-id: http://redmine.rubyforge.org/svn/branches/0.7-stable@1370 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-04-28 10:36:12 +00:00
parent be071deae2
commit 10191813ec
139 changed files with 1936 additions and 874 deletions
@@ -65,13 +65,24 @@ class RepositoriesCvsControllerTest < Test::Unit::TestCase
end
def test_browse_directory
get :browse, :id => 1, :path => ['sources']
get :browse, :id => 1, :path => ['images']
assert_response :success
assert_template 'browse'
assert_not_nil assigns(:entries)
entry = assigns(:entries).detect {|e| e.name == 'watchers_controller.rb'}
assert_equal ['add.png', 'delete.png', 'edit.png'], assigns(:entries).collect(&:name)
entry = assigns(:entries).detect {|e| e.name == 'edit.png'}
assert_not_nil entry
assert_equal 'file', entry.kind
assert_equal 'sources/watchers_controller.rb', entry.path
assert_equal 'images/edit.png', entry.path
end
def test_browse_at_given_revision
Project.find(1).repository.fetch_changesets
get :browse, :id => 1, :path => ['images'], :rev => 1
assert_response :success
assert_template 'browse'
assert_not_nil assigns(:entries)
assert_equal ['delete.png', 'edit.png'], assigns(:entries).collect(&:name)
end
def test_entry
@@ -90,6 +101,14 @@ class RepositoriesCvsControllerTest < Test::Unit::TestCase
get :entry, :id => 1, :path => ['sources', 'watchers_controller.rb'], :format => 'raw'
assert_response :success
end
def test_directory_entry
get :entry, :id => 1, :path => ['sources']
assert_response :success
assert_template 'browse'
assert_not_nil assigns(:entry)
assert_equal 'sources', assigns(:entry).name
end
def test_diff
Project.find(1).repository.fetch_changesets