diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-04-20 15:42:57 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-04-20 15:42:57 +0000 |
commit | 0fc884cf422356a2b57131daaa3340fd9da91b46 (patch) | |
tree | ae5953b3fe27844f63e29845ceb01c9308658108 /test/functional/users_controller_test.rb | |
parent | 657aa624a4e3ae6fca7148d13b08319031cf8380 (diff) | |
download | redmine-0fc884cf422356a2b57131daaa3340fd9da91b46.tar.gz redmine-0fc884cf422356a2b57131daaa3340fd9da91b46.zip |
Move more routing tests into the routing integration test.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3686 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/users_controller_test.rb')
-rw-r--r-- | test/functional/users_controller_test.rb | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb index 6823eb307..d178f8f85 100644 --- a/test/functional/users_controller_test.rb +++ b/test/functional/users_controller_test.rb @@ -34,21 +34,6 @@ class UsersControllerTest < ActionController::TestCase @request.session[:user_id] = 1 # admin end - def test_index_routing - assert_generates( - '/users', - :controller => 'users', :action => 'index' - ) - assert_routing( - {:method => :get, :path => '/users'}, - :controller => 'users', :action => 'index' - ) - assert_recognizes( - {:controller => 'users', :action => 'index'}, - {:method => :get, :path => '/users'} - ) - end - def test_index get :index assert_response :success @@ -74,17 +59,6 @@ class UsersControllerTest < ActionController::TestCase assert_equal 'John', users.first.firstname end - def test_show_routing - assert_routing( - {:method => :get, :path => '/users/44'}, - :controller => 'users', :action => 'show', :id => '44' - ) - assert_recognizes( - {:controller => 'users', :action => 'show', :id => '44'}, - {:method => :get, :path => '/users/44'} - ) - end - def test_show @request.session[:user_id] = nil get :show, :id => 2 @@ -123,38 +97,6 @@ class UsersControllerTest < ActionController::TestCase assert_not_nil assigns(:user) end - def test_add_routing - assert_routing( - {:method => :get, :path => '/users/new'}, - :controller => 'users', :action => 'add' - ) - assert_recognizes( - #TODO: remove this and replace with POST to collection, need to modify form - {:controller => 'users', :action => 'add'}, - {:method => :post, :path => '/users/new'} - ) - assert_recognizes( - {:controller => 'users', :action => 'add'}, - {:method => :post, :path => '/users'} - ) - end - - def test_edit_routing - assert_routing( - {:method => :get, :path => '/users/444/edit'}, - :controller => 'users', :action => 'edit', :id => '444' - ) - assert_routing( - {:method => :get, :path => '/users/222/edit/membership'}, - :controller => 'users', :action => 'edit', :id => '222', :tab => 'membership' - ) - assert_recognizes( - #TODO: use PUT on user_path, modify form - {:controller => 'users', :action => 'edit', :id => '444'}, - {:method => :post, :path => '/users/444/edit'} - ) - end - def test_edit ActionMailer::Base.deliveries.clear post :edit, :id => 2, :user => {:firstname => 'Changed'} @@ -192,20 +134,6 @@ class UsersControllerTest < ActionController::TestCase assert mail.body.include?('newpass') end - def test_add_membership_routing - assert_routing( - {:method => :post, :path => '/users/123/memberships'}, - :controller => 'users', :action => 'edit_membership', :id => '123' - ) - end - - def test_edit_membership_routing - assert_routing( - {:method => :post, :path => '/users/123/memberships/55'}, - :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55' - ) - end - def test_edit_membership post :edit_membership, :id => 2, :membership_id => 1, :membership => { :role_ids => [2]} @@ -214,14 +142,6 @@ class UsersControllerTest < ActionController::TestCase end def test_destroy_membership - assert_routing( - #TODO: use DELETE method on user_membership_path, modify form - {:method => :post, :path => '/users/567/memberships/12/destroy'}, - :controller => 'users', :action => 'destroy_membership', :id => '567', :membership_id => '12' - ) - end - - def test_destroy_membership post :destroy_membership, :id => 2, :membership_id => 1 assert_redirected_to :action => 'edit', :id => '2', :tab => 'memberships' assert_nil Member.find_by_id(1) |