mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 15:20:13 +01:00
fix bug #858 by adding information on todos to project xml and providing a test for it
This commit is contained in:
parent
46d4679f06
commit
71643bb1b0
2 changed files with 18 additions and 1 deletions
|
|
@ -107,7 +107,14 @@ class ProjectsController < ApplicationController
|
|||
respond_to do |format|
|
||||
format.html
|
||||
format.m &render_project_mobile
|
||||
format.xml { render :xml => @project.to_xml( :except => :user_id ) }
|
||||
format.xml {
|
||||
render :xml => @project.to_xml(:except => :user_id) { |xml|
|
||||
xml.not_done { @not_done.each { |child| child.to_xml(:builder => xml, :skip_instruct => true) } }
|
||||
xml.deferred { @deferred.each { |child| child.to_xml(:builder => xml, :skip_instruct => true) } }
|
||||
xml.pending { @pending.each { |child| child.to_xml(:builder => xml, :skip_instruct => true) } }
|
||||
xml.done { @done.each { |child| child.to_xml(:builder => xml, :skip_instruct => true) } }
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,16 @@ class ProjectXmlApiTest < ActionController::IntegrationTest
|
|||
def setup
|
||||
assert_test_environment_ok
|
||||
end
|
||||
|
||||
def test_retrieve_project
|
||||
authenticated_get_xml "/projects/1", users(:admin_user).login, 'abracadabra', {}
|
||||
assert_tag :tag => "project"
|
||||
assert_tag :tag => "project", :child => {:tag => "not_done" }
|
||||
assert_tag :tag => "project", :child => {:tag => "deferred" }
|
||||
assert_tag :tag => "project", :child => {:tag => "pending" }
|
||||
assert_tag :tag => "project", :child => {:tag => "done" }
|
||||
assert_response 200
|
||||
end
|
||||
|
||||
def test_fails_with_invalid_xml_format
|
||||
#Fails too hard for test to catch
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue