@@ -93,7 +93,7 class ProjectsController < ApplicationController | |||
|
93 | 93 | flash[:notice] = l(:notice_successful_create) |
|
94 | 94 | redirect_to :controller => 'projects', :action => 'settings', :id => @project |
|
95 | 95 | } |
|
96 |
format.xml { |
|
|
96 | format.xml { render :action => 'show', :status => :created, :location => url_for(:controller => 'projects', :action => 'show', :id => @project.id) } | |
|
97 | 97 | end |
|
98 | 98 | else |
|
99 | 99 | respond_to do |format| |
@@ -43,12 +43,15 class ProjectsApiTest < ActionController::IntegrationTest | |||
|
43 | 43 | assert_difference 'Project.count' do |
|
44 | 44 | post '/projects.xml', {:project => attributes}, :authorization => credentials('admin') |
|
45 | 45 | end |
|
46 | assert_response :created | |
|
47 | assert_equal 'application/xml', @response.content_type | |
|
46 | ||
|
48 | 47 | project = Project.first(:order => 'id DESC') |
|
49 | 48 | attributes.each do |attribute, value| |
|
50 | 49 | assert_equal value, project.send(attribute) |
|
51 | 50 | end |
|
51 | ||
|
52 | assert_response :created | |
|
53 | assert_equal 'application/xml', @response.content_type | |
|
54 | assert_tag 'project', :child => {:tag => 'id', :content => project.id.to_s} | |
|
52 | 55 | end |
|
53 | 56 | |
|
54 | 57 | def test_create_failure |
General Comments 0
You need to be logged in to leave comments.
Login now