2009-10-12 07:37:42 -04:00
|
|
|
require 'test/test_helper'
|
|
|
|
|
|
|
|
class MapRoutingTest < ActionController::TestCase
|
|
|
|
|
2009-10-16 19:46:06 -04:00
|
|
|
test 'map new user session' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/sessions', :action => 'new'}, {:path => 'users/sign_in', :method => :get})
|
2009-10-12 07:37:42 -04:00
|
|
|
end
|
|
|
|
|
2009-10-16 19:46:06 -04:00
|
|
|
test 'map create user session' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/sessions', :action => 'create'}, {:path => 'users/sign_in', :method => :post})
|
2009-10-16 12:44:51 -04:00
|
|
|
end
|
|
|
|
|
2009-10-16 19:46:06 -04:00
|
|
|
test 'map destroy user session' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/sessions', :action => 'destroy'}, {:path => 'users/sign_out', :method => :get})
|
2009-10-16 12:44:51 -04:00
|
|
|
end
|
|
|
|
|
2009-10-16 19:46:06 -04:00
|
|
|
test 'map new user confirmation' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/confirmations', :action => 'new'}, 'users/confirmation/new')
|
2009-10-12 07:37:42 -04:00
|
|
|
end
|
|
|
|
|
2009-10-16 19:46:06 -04:00
|
|
|
test 'map create user confirmation' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/confirmations', :action => 'create'}, {:path => 'users/confirmation', :method => :post})
|
2009-10-16 12:44:51 -04:00
|
|
|
end
|
|
|
|
|
2009-10-16 19:46:06 -04:00
|
|
|
test 'map show user confirmation' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/confirmations', :action => 'show'}, {:path => 'users/confirmation', :method => :get})
|
2009-10-16 12:44:51 -04:00
|
|
|
end
|
|
|
|
|
2009-10-16 19:46:06 -04:00
|
|
|
test 'map new user password' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/passwords', :action => 'new'}, 'users/password/new')
|
2009-10-12 07:37:42 -04:00
|
|
|
end
|
|
|
|
|
2009-10-16 19:46:06 -04:00
|
|
|
test 'map create user password' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/passwords', :action => 'create'}, {:path => 'users/password', :method => :post})
|
2009-10-16 12:44:51 -04:00
|
|
|
end
|
|
|
|
|
2009-10-16 19:46:06 -04:00
|
|
|
test 'map edit user password' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/passwords', :action => 'edit'}, 'users/password/edit')
|
2009-10-16 12:44:51 -04:00
|
|
|
end
|
|
|
|
|
2009-10-16 19:46:06 -04:00
|
|
|
test 'map update user password' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/passwords', :action => 'update'}, {:path => 'users/password', :method => :put})
|
2009-10-16 12:44:51 -04:00
|
|
|
end
|
|
|
|
|
2010-01-23 19:26:06 -05:00
|
|
|
test 'map new user unlock' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/unlocks', :action => 'new'}, 'users/unlock/new')
|
2010-01-23 19:26:06 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
test 'map create user unlock' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/unlocks', :action => 'create'}, {:path => 'users/unlock', :method => :post})
|
2010-01-23 19:26:06 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
test 'map show user unlock' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/unlocks', :action => 'show'}, {:path => 'users/unlock', :method => :get})
|
2010-01-23 19:26:06 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
test 'map new user registration' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/registrations', :action => 'new'}, 'users/sign_up')
|
2010-01-23 19:26:06 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
test 'map create user registration' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/registrations', :action => 'create'}, {:path => 'users', :method => :post})
|
2010-02-08 14:25:20 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
test 'map edit user registration' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/registrations', :action => 'edit'}, {:path => 'users/edit', :method => :get})
|
2010-02-08 14:25:20 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
test 'map update user registration' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/registrations', :action => 'update'}, {:path => 'users', :method => :put})
|
2010-02-08 14:25:20 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
test 'map destroy user registration' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/registrations', :action => 'destroy'}, {:path => 'users', :method => :delete})
|
2010-01-23 19:26:06 -05:00
|
|
|
end
|
|
|
|
|
2010-02-17 07:15:19 -05:00
|
|
|
test 'map admin with :as option' do
|
|
|
|
assert_recognizes({:controller => 'devise/registrations', :action => 'new'}, {:path => 'admin_area/sign_up', :method => :get})
|
|
|
|
end
|
|
|
|
|
|
|
|
test 'map admin with :controllers option' do
|
|
|
|
assert_recognizes({:controller => 'sessions', :action => 'new'}, {:path => 'admin_area/sign_in', :method => :get})
|
2009-10-12 07:37:42 -04:00
|
|
|
end
|
|
|
|
|
2009-10-16 19:46:06 -04:00
|
|
|
test 'does not map admin confirmation' do
|
2009-10-12 08:56:12 -04:00
|
|
|
assert_raise ActionController::RoutingError do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/confirmations', :action => 'new'}, 'admin_area/confirmation/new')
|
2009-10-12 08:56:12 -04:00
|
|
|
end
|
2009-10-12 07:37:42 -04:00
|
|
|
end
|
2009-10-12 09:18:14 -04:00
|
|
|
|
2009-10-16 19:46:06 -04:00
|
|
|
test 'map account with custom path name for session sign in' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/sessions', :action => 'new', :locale => 'en'}, '/en/accounts/login')
|
2009-10-16 19:46:06 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
test 'map account with custom path name for session sign out' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/sessions', :action => 'destroy', :locale => 'en'}, '/en/accounts/logout')
|
2009-10-16 19:46:06 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
test 'map account with custom path name for password' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/passwords', :action => 'new', :locale => 'en'}, '/en/accounts/secret/new')
|
2009-10-16 19:46:06 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
test 'map account with custom path name for confirmation' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/confirmations', :action => 'new', :locale => 'en'}, '/en/accounts/verification/new')
|
2009-11-13 05:49:22 -05:00
|
|
|
end
|
2010-01-13 13:45:24 -05:00
|
|
|
|
|
|
|
test 'map account with custom path name for unlock' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/unlocks', :action => 'new', :locale => 'en'}, '/en/accounts/unblock/new')
|
2010-01-13 13:45:24 -05:00
|
|
|
end
|
|
|
|
|
2010-01-23 19:26:06 -05:00
|
|
|
test 'map account with custom path name for registration' do
|
2010-02-17 06:25:20 -05:00
|
|
|
assert_recognizes({:controller => 'devise/registrations', :action => 'new', :locale => 'en'}, '/en/accounts/register')
|
2010-01-23 19:26:06 -05:00
|
|
|
end
|
2009-10-12 07:37:42 -04:00
|
|
|
end
|