diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index c3efbfd..a6a5c9e 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -93,7 +93,7 @@ class ProjectsController < ApplicationController flash[:notice] = l(:notice_successful_create) 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 else respond_to do |format| diff --git a/test/integration/projects_api_test.rb b/test/integration/projects_api_test.rb index e254c51..6b08d64 100644 --- a/test/integration/projects_api_test.rb +++ b/test/integration/projects_api_test.rb @@ -43,12 +43,15 @@ class ProjectsApiTest < ActionController::IntegrationTest assert_difference 'Project.count' do post '/projects.xml', {:project => attributes}, :authorization => credentials('admin') end - assert_response :created - assert_equal 'application/xml', @response.content_type + project = Project.first(:order => 'id DESC') attributes.each do |attribute, value| assert_equal value, project.send(attribute) end + + assert_response :created + assert_equal 'application/xml', @response.content_type + assert_tag 'project', :child => {:tag => 'id', :content => project.id.to_s} end def test_create_failure