backport test fix from 2.2devel

This commit is contained in:
Reinier Balt 2012-12-15 14:06:15 +01:00
parent b3f29a7601
commit 0d53c094ea
2 changed files with 9 additions and 7 deletions

View file

@ -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)

View file

@ -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