Refactor: Move the rest of the routing tests to RoutingTest.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3687 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -31,13 +31,6 @@ class DocumentsControllerTest < ActionController::TestCase
|
||||
User.current = nil
|
||||
end
|
||||
|
||||
def test_index_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/567/documents'},
|
||||
:controller => 'documents', :action => 'index', :project_id => '567'
|
||||
)
|
||||
end
|
||||
|
||||
def test_index
|
||||
# Sets a default category
|
||||
e = Enumeration.find_by_name('Technical documentation')
|
||||
@@ -54,17 +47,6 @@ class DocumentsControllerTest < ActionController::TestCase
|
||||
:content => 'Technical documentation'}
|
||||
end
|
||||
|
||||
def test_new_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/567/documents/new'},
|
||||
:controller => 'documents', :action => 'new', :project_id => '567'
|
||||
)
|
||||
assert_recognizes(
|
||||
{:controller => 'documents', :action => 'new', :project_id => '567'},
|
||||
{:method => :post, :path => '/projects/567/documents'}
|
||||
)
|
||||
end
|
||||
|
||||
def test_new_with_one_attachment
|
||||
ActionMailer::Base.deliveries.clear
|
||||
Setting.notified_events << 'document_added'
|
||||
@@ -87,31 +69,6 @@ class DocumentsControllerTest < ActionController::TestCase
|
||||
assert_equal 1, ActionMailer::Base.deliveries.size
|
||||
end
|
||||
|
||||
def test_edit_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/documents/22/edit'},
|
||||
:controller => 'documents', :action => 'edit', :id => '22'
|
||||
)
|
||||
assert_recognizes(#TODO: should be using PUT on document URI
|
||||
{:controller => 'documents', :action => 'edit', :id => '567'},
|
||||
{:method => :post, :path => '/documents/567/edit'}
|
||||
)
|
||||
end
|
||||
|
||||
def test_show_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/documents/22'},
|
||||
:controller => 'documents', :action => 'show', :id => '22'
|
||||
)
|
||||
end
|
||||
|
||||
def test_destroy_routing
|
||||
assert_recognizes(#TODO: should be using DELETE on document URI
|
||||
{:controller => 'documents', :action => 'destroy', :id => '567'},
|
||||
{:method => :post, :path => '/documents/567/destroy'}
|
||||
)
|
||||
end
|
||||
|
||||
def test_destroy
|
||||
@request.session[:user_id] = 2
|
||||
post :destroy, :id => 1
|
||||
|
||||
Reference in New Issue
Block a user