diff options
Diffstat (limited to 'test/functional/boards_controller_test.rb')
-rw-r--r-- | test/functional/boards_controller_test.rb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/functional/boards_controller_test.rb b/test/functional/boards_controller_test.rb index 3ff71bc4e..190eae237 100644 --- a/test/functional/boards_controller_test.rb +++ b/test/functional/boards_controller_test.rb @@ -31,6 +31,13 @@ class BoardsControllerTest < Test::Unit::TestCase User.current = nil end + def test_index_routing + assert_routing( + {:method => :get, :path => '/projects/world_domination/boards'}, + :controller => 'boards', :action => 'index', :project_id => 'world_domination' + ) + end + def test_index get :index, :project_id => 1 assert_response :success @@ -39,6 +46,24 @@ class BoardsControllerTest < Test::Unit::TestCase assert_not_nil assigns(:project) end + def test_new_routing + assert_routing( + {:method => :get, :path => '/projects/world_domination/boards/new'}, + :controller => 'boards', :action => 'new', :project_id => 'world_domination' + ) + assert_recognizes( + {:controller => 'boards', :action => 'new', :project_id => 'world_domination'}, + {:method => :post, :path => '/projects/world_domination/boards'} + ) + end + + def test_show_routing + assert_routing( + {:method => :get, :path => '/projects/world_domination/boards/44'}, + :controller => 'boards', :action => 'show', :id => '44', :project_id => 'world_domination' + ) + end + def test_show get :show, :project_id => 1, :id => 1 assert_response :success @@ -47,4 +72,22 @@ class BoardsControllerTest < Test::Unit::TestCase assert_not_nil assigns(:project) assert_not_nil assigns(:topics) end + + def test_edit_routing + assert_routing( + {:method => :get, :path => '/projects/world_domination/boards/44/edit'}, + :controller => 'boards', :action => 'edit', :id => '44', :project_id => 'world_domination' + ) + assert_recognizes(#TODO: use PUT method to board_path, modify form accordingly + {:controller => 'boards', :action => 'edit', :id => '44', :project_id => 'world_domination'}, + {:method => :post, :path => '/projects/world_domination/boards/44/edit'} + ) + end + + def test_destroy_routing + assert_routing(#TODO: use DELETE method to board_path, modify form accoringly + {:method => :post, :path => '/projects/world_domination/boards/44/destroy'}, + :controller => 'boards', :action => 'destroy', :id => '44', :project_id => 'world_domination' + ) + end end |