use new model to handle updating of recurring todos

This commit is contained in:
Reinier Balt 2014-02-03 10:48:21 +01:00
parent 00af159be7
commit c2c67f1640
12 changed files with 166 additions and 104 deletions

View file

@ -359,4 +359,30 @@ class RecurringTodosControllerTest < ActionController::TestCase
assert_equal "completed", rt.state, "repeat pattern should be completed"
end
def test_update_recurring_todo
login_as(:admin_user)
rt = recurring_todos(:call_bill_gates_every_day)
current_descr = rt.description
put :update,
"recurring_todo" => {
"description" => "changed",
"daily_selector" => "daily_every_x_day",
"daily_every_x_days" => "2",
"ends_on" => "no_end_date",
"recurring_target" => "show_from_date"
},
"recurring_edit_todo" => {
"recurring_period" => rt.recurring_period,
},
"recurring_todo_edit_start_from" => "2/1/2013",
"end_date" => nil,
"ends_on" => "no_end_date",
"id" => "#{rt.id}",
"context_name" => "library",
format: :js
assert_equal "changed", rt.reload.description
end
end