From deed1b949d6340c87a2cee9cca411e70d908eaf4 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Fri, 24 Sep 2010 16:26:46 +0000 Subject: Refactor: move NewsController#preview to PreviewsController#news git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4174 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/news_controller_test.rb | 11 ----------- test/functional/previews_controller_test.rb | 10 ++++++++++ test/integration/routing_test.rb | 6 +++++- 3 files changed, 15 insertions(+), 12 deletions(-) (limited to 'test') diff --git a/test/functional/news_controller_test.rb b/test/functional/news_controller_test.rb index 219c4d7a7..30ca5a26e 100644 --- a/test/functional/news_controller_test.rb +++ b/test/functional/news_controller_test.rb @@ -117,15 +117,4 @@ class NewsControllerTest < ActionController::TestCase assert_redirected_to 'projects/ecookbook/news' assert_nil News.find_by_id(1) end - - def test_preview - get :preview, :project_id => 1, - :news => {:title => '', - :description => 'News description', - :summary => ''} - assert_response :success - assert_template 'common/_preview' - assert_tag :tag => 'fieldset', :attributes => { :class => 'preview' }, - :content => /News description/ - end end diff --git a/test/functional/previews_controller_test.rb b/test/functional/previews_controller_test.rb index 63456d1d0..4140f1428 100644 --- a/test/functional/previews_controller_test.rb +++ b/test/functional/previews_controller_test.rb @@ -19,4 +19,14 @@ class PreviewsControllerTest < ActionController::TestCase assert_not_nil assigns(:notes) end + def test_news + get :news, :project_id => 1, + :news => {:title => '', + :description => 'News description', + :summary => ''} + assert_response :success + assert_template 'common/_preview' + assert_tag :tag => 'fieldset', :attributes => { :class => 'preview' }, + :content => /News description/ + end end diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb index 3376f9313..be12dd027 100644 --- a/test/integration/routing_test.rb +++ b/test/integration/routing_test.rb @@ -157,10 +157,14 @@ class RoutingTest < ActionController::IntegrationTest should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567' should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234' should_route :get, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567' - + should_route :get, "/news/123/preview", :controller => 'previews', :action => 'news', :id => '123' + should_route :get, "/news/preview", :controller => 'previews', :action => 'news' + should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567' should_route :post, "/news/567/destroy", :controller => 'news', :action => 'destroy', :id => '567' should_route :post, "/news/567/comments", :controller => 'comments', :action => 'create', :id => '567' + + should_route :post, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123' should_route :put, "/news/567/edit", :controller => 'news', :action => 'update', :id => '567' -- cgit v1.2.3