From 3bc29e29e091b56bcffeb07ffb9c37c328525f99 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Mon, 20 Sep 2010 15:13:48 +0000 Subject: Refactor: split NewsController#new into #new and #create methods. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4163 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/news_controller_test.rb | 8 ++++---- test/integration/routing_test.rb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/functional/news_controller_test.rb b/test/functional/news_controller_test.rb index 3abb9a7fb..dd782fa3b 100644 --- a/test/functional/news_controller_test.rb +++ b/test/functional/news_controller_test.rb @@ -65,12 +65,12 @@ class NewsControllerTest < ActionController::TestCase assert_template 'new' end - def test_post_new + def test_post_create ActionMailer::Base.deliveries.clear Setting.notified_events << 'news_added' @request.session[:user_id] = 2 - post :new, :project_id => 1, :news => { :title => 'NewsControllerTest', + post :create, :project_id => 1, :news => { :title => 'NewsControllerTest', :description => 'This is the description', :summary => '' } assert_redirected_to 'projects/ecookbook/news' @@ -98,9 +98,9 @@ class NewsControllerTest < ActionController::TestCase assert_equal 'Description changed by test_post_edit', news.description end - def test_post_new_with_validation_failure + def test_post_create_with_validation_failure @request.session[:user_id] = 2 - post :new, :project_id => 1, :news => { :title => '', + post :create, :project_id => 1, :news => { :title => '', :description => 'This is the description', :summary => '' } assert_response :success diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb index 794a7780e..1fc3f82d4 100644 --- a/test/integration/routing_test.rb +++ b/test/integration/routing_test.rb @@ -157,7 +157,7 @@ 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 :post, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567' + should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567' should_route :post, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567' should_route :post, "/news/567/destroy", :controller => 'news', :action => 'destroy', :id => '567' end -- cgit v1.2.3