mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-05 16:58:50 +01:00
Add Selenium test for bug #776 and bug #775 and resolve both. Also fixed an unreported issue where deferring a todo by editing its show_from wouldn't hide an empty context.
This commit is contained in:
parent
0a39e1ea7e
commit
397029dfc1
4 changed files with 40 additions and 6 deletions
|
|
@ -221,7 +221,13 @@ class TodosController < ApplicationController
|
|||
@saved = @todo.update_attributes params["todo"]
|
||||
@context_changed = @original_item_context_id != @todo.context_id
|
||||
@todo_was_activated_from_deferred_state = @original_item_was_deferred && @todo.active?
|
||||
determine_remaining_in_context_count(@original_item_context_id) if @context_changed
|
||||
|
||||
if @context_changed
|
||||
determine_remaining_in_context_count(@original_item_context_id)
|
||||
else
|
||||
determine_remaining_in_context_count(@todo.context_id)
|
||||
end
|
||||
|
||||
@project_changed = @original_item_project_id != @todo.project_id
|
||||
if (@project_changed && !@original_item_project_id.nil?) then @remaining_undone_in_project = current_user.projects.find(@original_item_project_id).not_done_todo_count; end
|
||||
determine_down_count
|
||||
|
|
@ -390,7 +396,9 @@ class TodosController < ApplicationController
|
|||
@todo = Todo.find(params[:id])
|
||||
@todo.show_from = (@todo.show_from || @todo.user.date) + numdays.days
|
||||
@saved = @todo.save
|
||||
|
||||
|
||||
determine_down_count
|
||||
determine_remaining_in_context_count(@todo.context_id)
|
||||
respond_to do |format|
|
||||
format.html { redirect_to :back }
|
||||
format.js {render :action => 'update'}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue