fix test failures after the changes and refactorings

This commit is contained in:
Reinier Balt 2011-06-12 04:29:35 +02:00
parent 559a02d6f1
commit 8546ae5dfa
8 changed files with 30 additions and 81 deletions

View file

@ -14,13 +14,11 @@ class ProjectsController < ApplicationController
projects_and_actions
else
@contexts = current_user.contexts.all
init_not_done_counts(['project'])
if params[:only_active_with_no_next_actions]
@projects = current_user.projects.active.select { |p| count_undone_todos(p) == 0 }
@projects = current_user.projects.active.select { |p| p.todos.count == 0 }
else
@projects = current_user.projects.all
end
init_project_hidden_todo_counts(['project'])
respond_to do |format|
format.html &render_projects_html
format.m &render_projects_mobile
@ -209,16 +207,12 @@ class ProjectsController < ApplicationController
@state = params['state']
@projects = current_user.projects.alphabetize(:state => @state) if @state
@contexts = current_user.contexts
init_not_done_counts(['project'])
init_project_hidden_todo_counts(['project']) if @state == 'hidden'
end
def actionize
@state = params['state']
@projects = current_user.projects.actionize(current_user.id, :state => @state) if @state
@projects = current_user.projects.actionize(:state => @state) if @state
@contexts = current_user.contexts
init_not_done_counts(['project'])
init_project_hidden_todo_counts(['project']) if @state == 'hidden'
end
protected
@ -293,7 +287,6 @@ class ProjectsController < ApplicationController
def render_text_feed
lambda do
init_project_hidden_todo_counts(['project'])
render :action => 'index', :layout => false, :content_type => Mime::TEXT
end
end