0
@@ -70,7 +70,7 @@ class TodosControllerTest < Test::Rails::TestCase
0
xhr :post, :destroy, :id => 1, :_source_view => 'todo'
0
assert_rjs :page, "todo_1", :remove
0
- #
assert_rjs :replace_html, "badge-count", '9' 0
+ #
#assert_rjs :replace_html, "badge-count", '9'0
@@ -90,11 +90,11 @@ class TodosControllerTest < Test::Rails::TestCase
0
def test_fail_to_create_todo_via_xml
0
- #
try to create with no context, which is not valid
0
+ #
#try to create with no context, which is not valid
0
put :create, :format => "xml", "request" => { "project_name"=>"Build a working time machine", "todo"=>{"notes"=>"", "description"=>"Call Warren Buffet to find out how much he makes per day", "due"=>"30/11/2006"}, "tag_list"=>"foo bar" }
0
assert_xml_select "errors" do
0
-
assert_xml_select "error", "Context can't be blank"
0
+
assert_xml_select "error", "Context can't be blank"
0
@@ -180,7 +180,7 @@ class TodosControllerTest < Test::Rails::TestCase
0
get :index, { :format => "rss" }
0
assert_equal 'application/rss+xml', @response.content_type
0
+ #
#puts @response.body
0
assert_xml_select 'rss[version="2.0"]' do
0
assert_select 'channel' do
0
@@ -237,7 +237,7 @@ class TodosControllerTest < Test::Rails::TestCase
0
get :index, { :format => "atom" }
0
assert_equal 'application/atom+xml', @response.content_type
0
+ #
#puts @response.body
0
assert_xml_select 'feed[xmlns="http://www.w3.org/2005/Atom"]' do
0
assert_xml_select '>title', 'Tracks Actions'
0
@@ -273,7 +273,7 @@ class TodosControllerTest < Test::Rails::TestCase
0
get :index, { :format => "txt" }
0
assert_equal 'text/plain', @response.content_type
0
assert !(/ /.match(@response.body))
0
+ #
#puts @response.body
0
def test_text_feed_not_accessible_to_anonymous_user_without_token
0
@@ -299,7 +299,7 @@ class TodosControllerTest < Test::Rails::TestCase
0
get :index, { :format => "ics" }
0
assert_equal 'text/calendar', @response.content_type
0
assert !(/ /.match(@response.body))
0
+ #
#puts @response.body
0
def test_mobile_index_uses_text_html_content_type
0
@@ -317,10 +317,10 @@ class TodosControllerTest < Test::Rails::TestCase
0
def test_mobile_create_action_creates_a_new_todo
0
post :create, {"format"=>"m", "todo"=>{"context_id"=>"2",
0
- "due(1i)"=>"2007", "due(2i)"=>"1", "due(3i)"=>"2",
0
- "show_from(1i)"=>"", "show_from(2i)"=>"", "show_from(3i)"=>"",
0
- "notes"=>"test notes", "description"=>"test_mobile_create_action", "state"=>"0"}}
0
+ "due(1i)"=>"2007", "due(2i)"=>"1", "due(3i)"=>"2",
0
+ "show_from(1i)"=>"", "show_from(2i)"=>"", "show_from(3i)"=>"",
0
+ "notes"=>"test notes", "description"=>"test_mobile_create_action", "state"=>"0"}}
0
t = Todo.find_by_description("test_mobile_create_action")
0
assert_equal 2, t.context_id
0
@@ -334,20 +334,20 @@ class TodosControllerTest < Test::Rails::TestCase
0
def test_mobile_create_action_redirects_to_mobile_home_page_when_successful
0
post :create, {"format"=>"m", "todo"=>{"context_id"=>"2",
0
- "due(1i)"=>"2007", "due(2i)"=>"1", "due(3i)"=>"2",
0
- "show_from(1i)"=>"", "show_from(2i)"=>"", "show_from(3i)"=>"",
0
- "notes"=>"test notes", "description"=>"test_mobile_create_action", "state"=>"0"}}
0
+ "due(1i)"=>"2007", "due(2i)"=>"1", "due(3i)"=>"2",
0
+ "show_from(1i)"=>"", "show_from(2i)"=>"", "show_from(3i)"=>"",
0
+ "notes"=>"test notes", "description"=>"test_mobile_create_action", "state"=>"0"}}
0
assert_redirected_to '/m'
0
def test_mobile_create_action_renders_new_template_when_save_fails
0
post :create, {"format"=>"m", "todo"=>{"context_id"=>"2",
0
- "due(1i)"=>"2007", "due(2i)"=>"1", "due(3i)"=>"2",
0
- "show_from(1i)"=>"", "show_from(2i)"=>"", "show_from(3i)"=>"",
0
- "notes"=>"test notes", "state"=>"0"}, "tag_list"=>"test, test2"}
0
+ "due(1i)"=>"2007", "due(2i)"=>"1", "due(3i)"=>"2",
0
+ "show_from(1i)"=>"", "show_from(2i)"=>"", "show_from(3i)"=>"",
0
+ "notes"=>"test notes", "state"=>"0"}, "tag_list"=>"test, test2"}
0
assert_template 'todos/new'
0
@@ -357,4 +357,25 @@ class TodosControllerTest < Test::Rails::TestCase
0
assert_equal '"{\\"Build a working time machine\\": \\"lab\\"}"', assigns(:default_project_context_name_map)
0
+ def test_toggle_check_on_recurring_todo
0
+ # link todo_1 and recurring_todo_1
0
+ recurring_todo_1 = RecurringTodo.find(1)
0
+ todo_1.recurring_todo_id = recurring_todo_1.id
0
+ # mark todo_1 as complete by toggle_check
0
+ xhr :post, :toggle_check, :id => 1, :_source_view => 'todo'
0
+ assert todo_1.completed?
0
+ # check there is a new todo linked to the recurring pattern
0
+ next_todo = Todo.find_by_recurring_todo_id(recurring_todo_1.id)
0
+ assert_equal "Call Bill Gates every day", next_todo.description