fixed tests for starred todos

This commit is contained in:
Demian Gemperli 2011-08-04 23:14:29 +02:00
parent 2441aa92b5
commit 367476bd77
5 changed files with 8 additions and 8 deletions

View file

@ -83,7 +83,7 @@ class TodosController < ApplicationController
@todo.context_id = context.id
end
@todo.starred= params[:new_todo_starred].include? "true"
@todo.starred= (params[:new_todo_starred]||"").include? "true"
@todo.add_predecessor_list(predecessor_list)

View file

@ -248,12 +248,12 @@ class Todo < ActiveRecord::Base
end
def toggle_star!
starred=!starred?
self.starred= !starred?
end
def starred=(starred)
if starred
_add_tags(STARRED_TAG_NAME)
_add_tags STARRED_TAG_NAME unless starred?
else
_remove_tags STARRED_TAG_NAME
end

View file

@ -1,5 +1,5 @@
<%- if @saved -%>
$('div#recurring_todo_<%= @recurring_todo.id %> a.star_item img').toggleClass('starred_todo').toggleClass('unstarred_todo');
$('div#recurring_todo_<%= @recurring_todo.id %> a.star_item img').toggleClass('starred');
<%- else -%>
TracksPages.page_notify('error', '<%= t('todos.error_starring_recurring', :description => @recurring_todo.description) %>', 8);
<%- end -%>