1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

Backported r4397 from trunk.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@4401 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2010-11-14 11:30:53 +00:00
parent c70ae6c735
commit 2a7a95d746
2 changed files with 6 additions and 3 deletions

View File

@ -93,7 +93,7 @@ class ProjectsController < ApplicationController
flash[:notice] = l(:notice_successful_create) flash[:notice] = l(:notice_successful_create)
redirect_to :controller => 'projects', :action => 'settings', :id => @project redirect_to :controller => 'projects', :action => 'settings', :id => @project
} }
format.xml { head :created, :location => url_for(:controller => 'projects', :action => 'show', :id => @project.id) } format.xml { render :action => 'show', :status => :created, :location => url_for(:controller => 'projects', :action => 'show', :id => @project.id) }
end end
else else
respond_to do |format| respond_to do |format|

View File

@ -43,12 +43,15 @@ class ProjectsApiTest < ActionController::IntegrationTest
assert_difference 'Project.count' do assert_difference 'Project.count' do
post '/projects.xml', {:project => attributes}, :authorization => credentials('admin') post '/projects.xml', {:project => attributes}, :authorization => credentials('admin')
end end
assert_response :created
assert_equal 'application/xml', @response.content_type
project = Project.first(:order => 'id DESC') project = Project.first(:order => 'id DESC')
attributes.each do |attribute, value| attributes.each do |attribute, value|
assert_equal value, project.send(attribute) assert_equal value, project.send(attribute)
end end
assert_response :created
assert_equal 'application/xml', @response.content_type
assert_tag 'project', :child => {:tag => 'id', :content => project.id.to_s}
end end
def test_create_failure def test_create_failure