Refactor: split NewsController#edit into #edit and #update

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4168 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis
2010-09-21 15:20:37 +00:00
parent 51359704a0
commit 01d1a02df4
7 changed files with 21 additions and 14 deletions
+2 -2
View File
@@ -90,9 +90,9 @@ class NewsControllerTest < ActionController::TestCase
assert_template 'edit'
end
def test_post_edit
def test_put_update
@request.session[:user_id] = 2
post :edit, :id => 1, :news => { :description => 'Description changed by test_post_edit' }
put :update, :id => 1, :news => { :description => 'Description changed by test_post_edit' }
assert_redirected_to 'news/1'
news = News.find(1)
assert_equal 'Description changed by test_post_edit', news.description
+3 -1
View File
@@ -156,10 +156,12 @@ class RoutingTest < ActionController::IntegrationTest
should_route :get, "/news/2", :controller => 'news', :action => 'show', :id => '2'
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 :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'
should_route :put, "/news/567/edit", :controller => 'news', :action => 'update', :id => '567'
end
context "projects" do