mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-07 17:58:50 +01:00
rename repeating -> recurring, repeat -> recurrence
This commit is contained in:
parent
ab02d09830
commit
dfe8735c0d
35 changed files with 125 additions and 125 deletions
|
|
@ -37,7 +37,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
|
|||
{
|
||||
"daily_every_x_days"=>"1",
|
||||
"daily_selector"=>"daily_every_x_day",
|
||||
"description"=>"new recurring pattern",
|
||||
"description"=>"new recurrence pattern",
|
||||
"end_date" => "31/08/2010",
|
||||
"ends_on" => "ends_on_end_date",
|
||||
"monthly_day_of_week" => "1",
|
||||
|
|
@ -122,7 +122,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
|
|||
login_as(:admin_user)
|
||||
|
||||
# check new rec todo is not there
|
||||
assert_nil RecurringTodo.where(:description => "new recurring pattern").first
|
||||
assert_nil RecurringTodo.where(:description => "new recurrence pattern").first
|
||||
|
||||
put :create,
|
||||
"context_name"=>"library",
|
||||
|
|
@ -131,7 +131,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
|
|||
{
|
||||
"daily_every_x_days"=>"1",
|
||||
"daily_selector"=>"daily_every_x_day",
|
||||
"description"=>"new recurring pattern",
|
||||
"description"=>"new recurrence pattern",
|
||||
"end_date" => "31/08/2010",
|
||||
"ends_on" => "ends_on_end_date",
|
||||
"monthly_day_of_week" => "1",
|
||||
|
|
@ -158,7 +158,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
|
|||
},
|
||||
"tag_list"=>"one, two, three, four", :format => :js
|
||||
|
||||
new_rec_todo = RecurringTodo.where(:description => "new recurring pattern").first
|
||||
new_rec_todo = RecurringTodo.where(:description => "new recurrence pattern").first
|
||||
|
||||
assert_not_nil new_rec_todo
|
||||
|
||||
|
|
@ -245,7 +245,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
|
|||
{
|
||||
"daily_every_x_days"=>"1",
|
||||
"daily_selector"=>"daily_every_x_day",
|
||||
"description"=>"new recurring pattern",
|
||||
"description"=>"new recurrence pattern",
|
||||
"end_date" => "",
|
||||
"ends_on" => "no_end_date",
|
||||
"monthly_day_of_week" => "1",
|
||||
|
|
@ -278,7 +278,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
|
|||
assert_equal orig_todo_count+1, Todo.count
|
||||
|
||||
# find the newly created todo
|
||||
new_todo = Todo.where(:description => "new recurring pattern").first
|
||||
new_todo = Todo.where(:description => "new recurrence pattern").first
|
||||
assert !new_todo.nil?
|
||||
|
||||
# the date should be 31 march 2013
|
||||
|
|
@ -299,7 +299,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
|
|||
{
|
||||
"daily_every_x_days"=>"1",
|
||||
"daily_selector"=>"daily_every_x_day",
|
||||
"description"=>"new recurring pattern",
|
||||
"description"=>"new recurrence pattern",
|
||||
"end_date" => "",
|
||||
"ends_on" => "no_end_date",
|
||||
"monthly_day_of_week" => "1",
|
||||
|
|
@ -332,7 +332,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
|
|||
assert_equal orig_todo_count+1, Todo.count
|
||||
|
||||
# find the newly created recurring todo
|
||||
recurring_todo = RecurringTodo.where(:description => "new recurring pattern").first
|
||||
recurring_todo = RecurringTodo.where(:description => "new recurrence pattern").first
|
||||
assert !recurring_todo.nil?
|
||||
|
||||
assert_equal "due_date", recurring_todo.target
|
||||
|
|
@ -351,7 +351,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
|
|||
{
|
||||
"daily_every_x_days"=>"1",
|
||||
"daily_selector"=>"daily_every_x_day",
|
||||
"description"=>"new recurring pattern",
|
||||
"description"=>"new recurrence pattern",
|
||||
"end_date" => nil,
|
||||
"ends_on" => "no_end_date",
|
||||
"monthly_day_of_week" => "2",
|
||||
|
|
@ -378,7 +378,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
|
|||
},
|
||||
"tag_list"=>"one, two, three, four", format: :js
|
||||
|
||||
assert_equal "new recurring pattern", assigns['recurring_todo'].description
|
||||
assert_equal "new recurrence pattern", assigns['recurring_todo'].description
|
||||
assert_equal "2013-01-02 00:00:00 +0000", assigns['recurring_todo'].start_from.to_s
|
||||
todo = assigns['recurring_todo'].todos.first
|
||||
assert_equal "2013-01-02 00:00:00 +0000", todo.show_from.to_s
|
||||
|
|
@ -393,12 +393,12 @@ class RecurringTodosControllerTest < ActionController::TestCase
|
|||
|
||||
assert_not_nil todo
|
||||
assert_equal "active", todo.state, "todo should be active"
|
||||
assert_equal "active", rt.state, "repeat pattern should be active"
|
||||
assert_equal "active", rt.state, "recurrence pattern should be active"
|
||||
|
||||
get :index # will call find_and_inactivate
|
||||
|
||||
rt.reload
|
||||
assert_equal "active", rt.state, "repeat pattern should still be active"
|
||||
assert_equal "active", rt.state, "recurrence pattern should still be active"
|
||||
|
||||
# disconnect todo from pattern thus leaving the pattern without
|
||||
# any active todos, but in active state
|
||||
|
|
@ -408,11 +408,11 @@ class RecurringTodosControllerTest < ActionController::TestCase
|
|||
|
||||
todo.reload
|
||||
rt.reload
|
||||
assert_equal "active", rt.state, "repeat pattern should still be active and not changed"
|
||||
assert_equal "active", rt.state, "recurrence pattern should still be active and not changed"
|
||||
|
||||
get :index
|
||||
rt.reload
|
||||
assert_equal "completed", rt.state, "repeat pattern should be completed"
|
||||
assert_equal "completed", rt.state, "recurrence pattern should be completed"
|
||||
end
|
||||
|
||||
def test_update_recurring_todo
|
||||
|
|
|
|||
|
|
@ -676,7 +676,7 @@ class TodosControllerTest < ActionController::TestCase
|
|||
count = Todo.where(:recurring_todo_id => recurring_todo_1.id, :state => 'active').count
|
||||
assert_equal 1, count
|
||||
|
||||
# check there is a new todo linked to the recurring pattern
|
||||
# check there is a new todo linked to the recurrence pattern
|
||||
next_todo = Todo.where(:recurring_todo_id => recurring_todo_1.id, :state => 'active').first
|
||||
assert_equal "Call Bill Gates every day", next_todo.description
|
||||
# check that the new todo is not the same as todo_1
|
||||
|
|
@ -706,7 +706,7 @@ class TodosControllerTest < ActionController::TestCase
|
|||
count = Todo.where(:recurring_todo_id => recurring_todo_1.id).count
|
||||
assert_equal 3, count
|
||||
|
||||
# check there is a new todo linked to the recurring pattern in the tickler
|
||||
# check there is a new todo linked to the recurrence pattern in the tickler
|
||||
next_todo = Todo.where(:recurring_todo_id => recurring_todo_1.id, :state => 'deferred').first
|
||||
assert !next_todo.nil?
|
||||
assert_equal "Call Bill Gates every day", next_todo.description
|
||||
|
|
@ -758,16 +758,16 @@ class TodosControllerTest < ActionController::TestCase
|
|||
|
||||
tomorrow = Time.zone.now + 1.day
|
||||
|
||||
# Given a repeat pattern with recurring date set to tomorrow
|
||||
# Given a recurrence pattern with recurring date set to tomorrow
|
||||
recurring_todo_1 = RecurringTodo.find(5)
|
||||
recurring_todo_1.every_other1 = tomorrow.day
|
||||
recurring_todo_1.every_other2 = tomorrow.month
|
||||
recurring_todo_1.save
|
||||
|
||||
# Given a recurring todo (todo) that belongs to the repeat pattern (recurring_todo_1) and is due tomorrow
|
||||
# Given a recurring todo (todo) that belongs to the recurrence pattern (recurring_todo_1) and is due tomorrow
|
||||
todo = Todo.where(:recurring_todo_id => 1).first
|
||||
assert todo.from_recurring_todo?
|
||||
todo.recurring_todo_id = 5 # rewire todo to the repeat pattern above
|
||||
todo.recurring_todo_id = 5 # rewire todo to the recurrence pattern above
|
||||
todo.due = tomorrow
|
||||
todo.save!
|
||||
|
||||
|
|
@ -776,7 +776,7 @@ class TodosControllerTest < ActionController::TestCase
|
|||
todo = Todo.find(todo.id) #reload does not seem to work here
|
||||
assert todo.completed?
|
||||
|
||||
# Then there should not be an active todo belonging to the repeat pattern
|
||||
# Then there should not be an active todo belonging to the recurrence pattern
|
||||
next_todo = Todo.where(:recurring_todo_id => recurring_todo_1.id, :state => 'active').first
|
||||
assert next_todo.nil?
|
||||
|
||||
|
|
@ -794,7 +794,7 @@ class TodosControllerTest < ActionController::TestCase
|
|||
|
||||
tomorrow = Time.zone.now + 1.day
|
||||
|
||||
# Given a monthly repeat pattern
|
||||
# Given a monthly recurrence pattern
|
||||
recurring_todo = RecurringTodo.find(5)
|
||||
recurring_todo.target = "due_date"
|
||||
recurring_todo.recurring_period = "monthly"
|
||||
|
|
@ -802,10 +802,10 @@ class TodosControllerTest < ActionController::TestCase
|
|||
recurring_todo.every_other2 = 1
|
||||
recurring_todo.save
|
||||
|
||||
# Given a recurring todo (todo) that belongs to the repeat pattern (recurring_todo) and is due tomorrow
|
||||
# Given a recurring todo (todo) that belongs to the recurrence pattern (recurring_todo) and is due tomorrow
|
||||
todo = Todo.where(:recurring_todo_id => 1).first
|
||||
assert todo.from_recurring_todo?
|
||||
todo.recurring_todo_id = 5 # rewire todo to the repeat pattern above
|
||||
todo.recurring_todo_id = 5 # rewire todo to the recurrence pattern above
|
||||
todo.due = tomorrow
|
||||
todo.save!
|
||||
|
||||
|
|
@ -814,7 +814,7 @@ class TodosControllerTest < ActionController::TestCase
|
|||
todo.reload
|
||||
assert todo.completed?
|
||||
|
||||
# Then there should not be an active todo belonging to the repeat pattern
|
||||
# Then there should not be an active todo belonging to the recurrence pattern
|
||||
next_todo = Todo.where(:recurring_todo_id => recurring_todo.id, :state => 'active').first
|
||||
assert next_todo.nil?
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue