Refactor: Split VersionsController#edit into #edit and #update

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4088 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis
2010-09-15 16:50:25 +00:00
parent cdfc57d544
commit be6e0927f3
6 changed files with 17 additions and 5 deletions
+2 -2
View File
@@ -113,9 +113,9 @@ class VersionsControllerTest < ActionController::TestCase
assert_not_nil Version.find_by_status('closed')
end
def test_post_edit
def test_post_update
@request.session[:user_id] = 2
post :edit, :id => 2,
post :update, :id => 2,
:version => { :name => 'New version name',
:effective_date => Date.today.strftime("%Y-%m-%d")}
assert_redirected_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => 'ecookbook'
+6
View File
@@ -251,10 +251,16 @@ class RoutingTest < ActionController::IntegrationTest
should_route :post, "/users/567/memberships/12/destroy", :controller => 'users', :action => 'destroy_membership', :id => '567', :membership_id => '12'
end
# TODO: should they all be scoped under /projects/:project_id ?
context "versions" do
should_route :get, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo'
should_route :get, "/versions/show/1", :controller => 'versions', :action => 'show', :id => '1'
should_route :get, "/versions/edit/1", :controller => 'versions', :action => 'edit', :id => '1'
should_route :post, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo'
should_route :post, "/versions/update/1", :controller => 'versions', :action => 'update', :id => '1'
should_route :delete, "/versions/destroy/1", :controller => 'versions', :action => 'destroy', :id => '1'
end
context "wiki (singular, project's pages)" do