From 7557ed147a18152ddc03656fb10f3781dd474c53 Mon Sep 17 00:00:00 2001 From: "Carlos A. da Silva" Date: Sat, 10 Oct 2009 09:41:16 -0300 Subject: [PATCH] Route tests. --- test/routes/confirmation_routing_test.rb | 18 +++++++++++++++--- test/routes/password_routing_test.rb | 24 ++++++++++++++++++++---- test/routes/session_routing_test.rb | 18 +++++++++++++++--- 3 files changed, 50 insertions(+), 10 deletions(-) diff --git a/test/routes/confirmation_routing_test.rb b/test/routes/confirmation_routing_test.rb index d26bcee3..ef7f2c9a 100644 --- a/test/routes/confirmation_routing_test.rb +++ b/test/routes/confirmation_routing_test.rb @@ -2,15 +2,15 @@ require 'test_helper' class ConfirmationRoutingTest < ActionController::TestCase - test 'new session route' do + test 'new user session route' do assert_recognizes({:controller => 'confirmations', :action => 'new'}, 'users/confirmation/new') end - test 'create confirmation route' do + test 'create user confirmation route' do assert_recognizes({:controller => 'confirmations', :action => 'create'}, {:path => 'users/confirmation', :method => :post}) end - test 'show confirmation route' do + test 'show user confirmation route' do assert_recognizes({:controller => 'confirmations', :action => 'show'}, 'users/confirmation') end @@ -19,4 +19,16 @@ class ConfirmationRoutingTest < ActionController::TestCase assert_recognizes({:controller => 'confirmations', :action => 'new'}, 'users/confirmacao/new') end end + + test 'new account session route' do + assert_recognizes({:controller => 'confirmations', :action => 'new'}, 'conta/confirmation/new') + end + + test 'create account confirmation route' do + assert_recognizes({:controller => 'confirmations', :action => 'create'}, {:path => 'conta/confirmation', :method => :post}) + end + + test 'show account confirmation route' do + assert_recognizes({:controller => 'confirmations', :action => 'show'}, 'conta/confirmation') + end end diff --git a/test/routes/password_routing_test.rb b/test/routes/password_routing_test.rb index 9a6dce85..415bd4bf 100644 --- a/test/routes/password_routing_test.rb +++ b/test/routes/password_routing_test.rb @@ -2,19 +2,19 @@ require 'test_helper' class PasswordRoutingTest < ActionController::TestCase - test 'new password route' do + test 'new user password route' do assert_recognizes({:controller => 'passwords', :action => 'new'}, 'users/password/new') end - test 'create password route' do + test 'create user password route' do assert_recognizes({:controller => 'passwords', :action => 'create'}, {:path => 'users/password', :method => :post}) end - test 'edit password route' do + test 'edit user password route' do assert_recognizes({:controller => 'passwords', :action => 'edit'}, 'users/password/edit') end - test 'update password route' do + test 'update user password route' do assert_recognizes({:controller => 'passwords', :action => 'update'}, {:path => 'users/password', :method => :put}) end @@ -23,4 +23,20 @@ class PasswordRoutingTest < ActionController::TestCase assert_recognizes({:controller => 'passwords', :action => 'new'}, 'users/senha/new') end end + + test 'new account password route' do + assert_recognizes({:controller => 'passwords', :action => 'new'}, 'conta/password/new') + end + + test 'create account password route' do + assert_recognizes({:controller => 'passwords', :action => 'create'}, {:path => 'conta/password', :method => :post}) + end + + test 'edit account password route' do + assert_recognizes({:controller => 'passwords', :action => 'edit'}, 'conta/password/edit') + end + + test 'update account password route' do + assert_recognizes({:controller => 'passwords', :action => 'update'}, {:path => 'conta/password', :method => :put}) + end end diff --git a/test/routes/session_routing_test.rb b/test/routes/session_routing_test.rb index 527b867b..cd2c36bb 100644 --- a/test/routes/session_routing_test.rb +++ b/test/routes/session_routing_test.rb @@ -2,15 +2,15 @@ require 'test_helper' class SessionRoutingTest < ActionController::TestCase - test 'new session route' do + test 'new user session route' do assert_recognizes({:controller => 'sessions', :action => 'new'}, 'users/session/new') end - test 'create session route' do + test 'create user session route' do assert_recognizes({:controller => 'sessions', :action => 'create'}, {:path => 'users/session', :method => :post}) end - test 'destroy session route' do + test 'destroy user session route' do assert_recognizes({:controller => 'sessions', :action => 'destroy'}, {:path => 'users/session', :method => :delete}) end @@ -19,4 +19,16 @@ class SessionRoutingTest < ActionController::TestCase assert_recognizes({:controller => 'sessions', :action => 'new'}, 'users/sessao/new') end end + + test 'new account session route' do + assert_recognizes({:controller => 'sessions', :action => 'new'}, 'conta/session/new') + end + + test 'create account session route' do + assert_recognizes({:controller => 'sessions', :action => 'create'}, {:path => 'conta/session', :method => :post}) + end + + test 'destroy account session route' do + assert_recognizes({:controller => 'sessions', :action => 'destroy'}, {:path => 'conta/session', :method => :delete}) + end end