From 081a55d6ac18bab5d117ec396365cd9013881c6e Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Sun, 13 Nov 2011 21:39:04 +0100 Subject: [PATCH] Fixup tests --- test/integration/todo_xml_api_test.rb | 33 +++++++++++++++------------ 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/test/integration/todo_xml_api_test.rb b/test/integration/todo_xml_api_test.rb index 21da3fdb..6b080a41 100644 --- a/test/integration/todo_xml_api_test.rb +++ b/test/integration/todo_xml_api_test.rb @@ -25,10 +25,10 @@ class TodoXmlApiTest < ActionController::IntegrationTest assert_response 401 end - def test_get_tickler_returns_all_deferred_todos - number = @user.todos.deferred.count + def test_get_tickler_returns_all_deferred_and_pending_todos + number = @user.todos.deferred.count + @user.todos.pending.count authenticated_get_xml "/tickler", @user.login, @password, {} - assert_tag :tag => "todos", :children => { :count => number, :only => { :tag => "todo" } } + assert_tag :tag => "todos", :children => { :count => number } end def test_get_tickler_omits_user_id @@ -36,13 +36,13 @@ class TodoXmlApiTest < ActionController::IntegrationTest assert_no_tag :tag => "user_id" end - def test_create_todo_via_xml_show_from + def test_create_todo_with_show_from old_count = @user.todos.count authenticated_post_xml_to_todo_create " Call Warren Buffet to find out how much he makes per day - #{projects(:attendrailsconf).id} - #{contexts(:office_otheruser).id} + #{contexts(:office).id} + #{projects(:timemachine).id} #{1.week.from_now.xmlschema} " @@ -54,8 +54,8 @@ class TodoXmlApiTest < ActionController::IntegrationTest authenticated_post_xml_to_todo_create " this will succeed 2 - 8 - 1 + #{contexts(:office).id} + #{projects(:timemachine).id} 5 6 @@ -72,8 +72,8 @@ class TodoXmlApiTest < ActionController::IntegrationTest authenticated_post_xml_to_todo_create " this will succeed 3 - 8 - 1 + #{contexts(:office).id} + #{projects(:timemachine).id} starred starred2 @@ -90,7 +90,7 @@ class TodoXmlApiTest < ActionController::IntegrationTest authenticated_post_xml_to_todo_create " this will succeed 4 - 1 + #{projects(:timemachine).id} @SomeNewContext @@ -103,11 +103,11 @@ class TodoXmlApiTest < ActionController::IntegrationTest assert_equal todo.context.name, "@SomeNewContext" end - def test_post_create_todo_with_new_context + def test_post_create_todo_with_new_project authenticated_post_xml_to_todo_create " this will succeed 5 - 8 + #{contexts(:office).id} Make even more money @@ -121,7 +121,12 @@ class TodoXmlApiTest < ActionController::IntegrationTest end def test_post_create_todo_with_wrong_project_and_context_id - authenticated_post_xml_to_todo_create "this will fail-16-11" + authenticated_post_xml_to_todo_create " + + this will fail + -16 + -11 +" assert_response 422 assert_xml_select 'errors' do assert_select 'error', 2