@@ -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| |
@@ -106,6 +106,10 class ApiTest::IssuesTest < ActionController::IntegrationTest | |||
|
106 | 106 | assert_equal 2, issue.tracker_id |
|
107 | 107 | assert_equal 3, issue.status_id |
|
108 | 108 | assert_equal 'API test', issue.subject |
|
109 | ||
|
110 | assert_response :created | |
|
111 | assert_equal 'application/xml', @response.content_type | |
|
112 | assert_tag 'issue', :child => {:tag => 'id', :content => issue.id.to_s} | |
|
109 | 113 | end |
|
110 | 114 | end |
|
111 | 115 |
@@ -52,12 +52,15 class ApiTest::ProjectsTest < ActionController::IntegrationTest | |||
|
52 | 52 | assert_difference 'Project.count' do |
|
53 | 53 | post '/projects.xml', {:project => attributes}, :authorization => credentials('admin') |
|
54 | 54 | end |
|
55 | assert_response :created | |
|
56 | assert_equal 'application/xml', @response.content_type | |
|
55 | ||
|
57 | 56 | project = Project.first(:order => 'id DESC') |
|
58 | 57 | attributes.each do |attribute, value| |
|
59 | 58 | assert_equal value, project.send(attribute) |
|
60 | 59 | end |
|
60 | ||
|
61 | assert_response :created | |
|
62 | assert_equal 'application/xml', @response.content_type | |
|
63 | assert_tag 'project', :child => {:tag => 'id', :content => project.id.to_s} | |
|
61 | 64 | end |
|
62 | 65 | |
|
63 | 66 | def test_create_failure |
General Comments 0
You need to be logged in to leave comments.
Login now