fix #1310. Add test for this

Found that I had a lot of tests commented out. They have some regressions I will fix later
This commit is contained in:
Reinier Balt 2012-07-15 21:28:42 +02:00
parent 5a24644aad
commit 7c1cd2a144
6 changed files with 696 additions and 694 deletions

View file

@ -343,7 +343,7 @@ class TodosController < ApplicationController
def remove_predecessor
@source_view = params['_source_view'] || 'todo'
@todo = current_user.todos.find_by_id(params['id']).includes(Todo::DEFAULT_INCLUDES)
@todo = current_user.todos.includes(Todo::DEFAULT_INCLUDES).find_by_id(params['id'])
@predecessor = current_user.todos.find_by_id(params['predecessor'])
@predecessors = @predecessor.predecessors
@successor = @todo
@ -449,8 +449,8 @@ class TodosController < ApplicationController
end
def change_context
# TODO: is this method used?
@todo = Todo.find_by_id(params[:todo][:id])
# change context if you drag a todo to another context
@todo = Todo.find_by_id(params[:id])
@original_item_context_id = @todo.context_id
@context = Context.find_by_id(params[:todo][:context_id])
@todo.context = @context
@ -1225,7 +1225,7 @@ class TodosController < ApplicationController
end
def update_todo_state_if_project_changed
if ( @project_changed ) then
if @project_changed
@todo.update_state_from_project
@remaining_undone_in_project = current_user.projects.find_by_id(@original_item_project_id).todos.active.count if source_view_is :project
end