Fixes #432: Could not successfully set project to None while editing a Todo.

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@422 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2007-02-04 04:16:50 +00:00
parent eb1709b053
commit 6045a7a986
3 changed files with 27 additions and 3 deletions

View file

@ -64,6 +64,22 @@ class TodosControllerTest < Test::Unit::TestCase
#assert_rjs :replace_html, "badge-count", '9'
end
def test_update_item_project
t = Todo.find(1)
@request.session['user_id'] = users(:admin_user).id
xhr :post, :update, :id => 1, :_source_view => 'todo', "context_name"=>"library", "project_name"=>"Build a working time machine", "item"=>{"id"=>"1", "notes"=>"", "description"=>"Call Warren Buffet to find out how much he makes per day", "due"=>"30/11/2006"}, "tag_list"=>"foo bar"
t = Todo.find(1)
assert_equal 1, t.project_id
end
def test_update_item_project_to_none
t = Todo.find(1)
@request.session['user_id'] = users(:admin_user).id
xhr :post, :update, :id => 1, :_source_view => 'todo', "context_name"=>"library", "project_name"=>"None", "item"=>{"id"=>"1", "notes"=>"", "description"=>"Call Warren Buffet to find out how much he makes per day", "due"=>"30/11/2006"}, "tag_list"=>"foo bar"
t = Todo.find(1)
assert_nil t.project_id
end
def test_update_item
t = Todo.find(1)
@request.session['user_id'] = users(:admin_user).id