From 0d53c094ea6e05044f20b392c2a21f7c4dd05b5d Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Sat, 15 Dec 2012 14:06:15 +0100 Subject: [PATCH] backport test fix from 2.2devel --- Gemfile.lock | 2 +- test/functional/todos_controller_test.rb | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0c888954..ea75520d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -140,7 +140,7 @@ DEPENDENCIES RedCloth (= 4.2.8) ZenTest (>= 4.0.0) aasm (~> 2.2.0) - acts_as_list (~> 0.1.4) + acts_as_list (= 0.1.4) aruba (= 0.2.2)! bcrypt-ruby (~> 2.1.4) capybara (>= 0.3.5) diff --git a/test/functional/todos_controller_test.rb b/test/functional/todos_controller_test.rb index fcdc20bc..063c8cdb 100644 --- a/test/functional/todos_controller_test.rb +++ b/test/functional/todos_controller_test.rb @@ -582,18 +582,20 @@ class TodosControllerTest < ActionController::TestCase def test_removing_hidden_project_activates_todo login_as(:admin_user) - + # get a project and hide it, todos in the project should be hidden p = projects(:timemachine) p.hide! assert p.reload().hidden? todo = p.todos.first - assert_equal "project_hidden", todo.state - + + assert todo.project_hidden?, "todo should be project_hidden" + # clear project from todo: the todo should be unhidden - xhr :post, :update, :id => 5, :_source_view => 'todo', "project_name"=>"None", "todo"=>{} - todo.reload() - assert_equal "active", todo.state + xhr :post, :update, :id => todo.id, :_source_view => 'todo', "project_name"=>"None", "todo"=>{} + + assert assigns['project_changed'], "the project of the todo should be changed" + assert todo.reload().active?, "todo should be active" end def test_url_with_slash_in_query_string_are_parsed_correctly