Merged r4051 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@4121 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
|
||||
class FilesControllerTest < ActionController::TestCase
|
||||
fixtures :all
|
||||
|
||||
def setup
|
||||
@controller = FilesController.new
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
@request.session[:user_id] = nil
|
||||
Setting.default_language = 'en'
|
||||
end
|
||||
|
||||
def test_index
|
||||
get :index, :id => 1
|
||||
assert_response :success
|
||||
assert_template 'index'
|
||||
assert_not_nil assigns(:containers)
|
||||
|
||||
# file attached to the project
|
||||
assert_tag :a, :content => 'project_file.zip',
|
||||
:attributes => { :href => '/attachments/download/8/project_file.zip' }
|
||||
|
||||
# file attached to a project's version
|
||||
assert_tag :a, :content => 'version_file.zip',
|
||||
:attributes => { :href => '/attachments/download/9/version_file.zip' }
|
||||
end
|
||||
|
||||
end
|
||||
@@ -353,21 +353,6 @@ class ProjectsControllerTest < ActionController::TestCase
|
||||
assert_equal Version.find(2), a.container
|
||||
end
|
||||
|
||||
def test_list_files
|
||||
get :list_files, :id => 1
|
||||
assert_response :success
|
||||
assert_template 'list_files'
|
||||
assert_not_nil assigns(:containers)
|
||||
|
||||
# file attached to the project
|
||||
assert_tag :a, :content => 'project_file.zip',
|
||||
:attributes => { :href => '/attachments/download/8/project_file.zip' }
|
||||
|
||||
# file attached to a project's version
|
||||
assert_tag :a, :content => 'version_file.zip',
|
||||
:attributes => { :href => '/attachments/download/9/version_file.zip' }
|
||||
end
|
||||
|
||||
def test_archive
|
||||
@request.session[:user_id] = 1 # admin
|
||||
post :archive, :id => 1
|
||||
|
||||
@@ -172,7 +172,7 @@ class RoutingTest < ActionController::IntegrationTest
|
||||
should_route :get, "/projects/4223/settings", :controller => 'projects', :action => 'settings', :id => '4223'
|
||||
should_route :get, "/projects/4223/settings/members", :controller => 'projects', :action => 'settings', :id => '4223', :tab => 'members'
|
||||
should_route :get, "/projects/567/destroy", :controller => 'projects', :action => 'destroy', :id => '567'
|
||||
should_route :get, "/projects/33/files", :controller => 'projects', :action => 'list_files', :id => '33'
|
||||
should_route :get, "/projects/33/files", :controller => 'files', :action => 'index', :id => '33'
|
||||
should_route :get, "/projects/33/files/new", :controller => 'projects', :action => 'add_file', :id => '33'
|
||||
should_route :get, "/projects/33/roadmap", :controller => 'versions', :action => 'index', :project_id => '33'
|
||||
should_route :get, "/projects/33/activity", :controller => 'activities', :action => 'index', :id => '33'
|
||||
|
||||
Reference in New Issue
Block a user