mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-31 13:15:17 +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?
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ require 'test_helper'
|
|||
|
||||
module RecurringTodos
|
||||
|
||||
class AbstractRepeatPatternTest < ActiveSupport::TestCase
|
||||
class AbstractRecurrencePatternTest < ActiveSupport::TestCase
|
||||
fixtures :users
|
||||
|
||||
def setup
|
||||
|
|
@ -14,7 +14,7 @@ module RecurringTodos
|
|||
rt = @admin.recurring_todos.first
|
||||
|
||||
pattern = rt.pattern
|
||||
assert pattern.is_a?(DailyRepeatPattern), "recurring todo should have daily pattern"
|
||||
assert pattern.is_a?(DailyRecurrencePattern), "recurring todo should have daily pattern"
|
||||
end
|
||||
|
||||
def test_validation_on_due_date
|
||||
|
|
@ -156,7 +156,7 @@ module RecurringTodos
|
|||
create_pattern(attributes.reverse_merge({
|
||||
'recurring_period' => 'weekly',
|
||||
'recurring_target' => 'due_date',
|
||||
'description' => 'a repeating todo', # generic
|
||||
'description' => 'a recurring todo', # generic
|
||||
'ends_on' => 'ends_on_end_date',
|
||||
'end_date' => Time.zone.now + 1.week,
|
||||
'context_id' => @admin.contexts.first.id,
|
||||
|
|
@ -5,7 +5,7 @@ module RecurringTodos
|
|||
class AbstractRecurringTodosBuilderTest < ActiveSupport::TestCase
|
||||
fixtures :users
|
||||
|
||||
class TestRepeatPattern < AbstractRepeatPattern
|
||||
class TestRecurringPattern < AbstractRecurrencePattern
|
||||
def selector_key
|
||||
'test'
|
||||
end
|
||||
|
|
@ -33,7 +33,7 @@ module RecurringTodos
|
|||
})
|
||||
|
||||
assert_raise(Exception, "should have exception since we are using abstract builder") do
|
||||
builder = AbstractRecurringTodosBuilder.new(@admin, attributes, DailyRepeatPattern)
|
||||
builder = AbstractRecurringTodosBuilder.new(@admin, attributes, DailyRecurrencePattern)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ require 'test_helper'
|
|||
|
||||
module RecurringTodos
|
||||
|
||||
class DailyRepeatPatternTest < ActiveSupport::TestCase
|
||||
class DailyRecurrencePatternTest < ActiveSupport::TestCase
|
||||
fixtures :users
|
||||
|
||||
def setup
|
||||
|
|
@ -17,7 +17,7 @@ module RecurringTodos
|
|||
def test_filter_non_daily_attributes
|
||||
attributes = {
|
||||
'recurring_period' => 'daily',
|
||||
'description' => 'a repeating todo', # generic
|
||||
'description' => 'a recurring todo', # generic
|
||||
'daily_selector' => 'daily_every_x_day', # daily specific
|
||||
'bla_bla' => 'go away' # irrelevant for daily
|
||||
}
|
||||
|
|
@ -27,7 +27,7 @@ module RecurringTodos
|
|||
assert_nil result.get('bla_bla'), "bla_bla should be filtered"
|
||||
assert_nil result.get(:bla_bla), "bla_bla should be filtered"
|
||||
assert_equal false, result.get(:only_work_days), "daily attributes should be preserved"
|
||||
assert_equal "a repeating todo", result.get(:description), "description should be preserved"
|
||||
assert_equal "a recurring todo", result.get(:description), "description should be preserved"
|
||||
end
|
||||
|
||||
def test_valid_selector
|
||||
|
|
@ -54,7 +54,7 @@ module RecurringTodos
|
|||
def test_mapping_of_attributes
|
||||
attributes = Tracks::AttributeHandler.new(@admin, {
|
||||
'recurring_period' => 'daily',
|
||||
'description' => 'a repeating todo', # generic
|
||||
'description' => 'a recurring todo', # generic
|
||||
'daily_selector' => 'daily_every_x_day', # daily specific --> mapped to only_work_days=false
|
||||
'daily_every_x_days' => '5' # mapped to every_other1
|
||||
})
|
||||
|
|
@ -66,7 +66,7 @@ module RecurringTodos
|
|||
|
||||
attributes = Tracks::AttributeHandler.new(@admin, {
|
||||
'recurring_period' => 'daily',
|
||||
'description' => 'a repeating todo', # generic
|
||||
'description' => 'a recurring todo', # generic
|
||||
'daily_selector' => 'daily_every_work_day', # daily specific --> mapped to only_work_days=true
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@ module RecurringTodos
|
|||
|
||||
h = FormHelper.new(rt)
|
||||
|
||||
assert_equal 42, h.daily_every_x_days, "should be passed to DailyRepeatPattern"
|
||||
assert_equal 42, h.weekly_every_x_week, "should be passed to WeeklyRepeatPattern"
|
||||
assert_equal 42, h.monthly_every_x_day, "should be passed to MonthlyRepeatPattern"
|
||||
assert_equal 42, h.yearly_every_x_day, "should be passed to YearlyRepeatPattern"
|
||||
assert h.on_monday, "should be passed to WeeklyRepeatPattern"
|
||||
assert_equal 42, h.daily_every_x_days, "should be passed to DailyRecurrencePattern"
|
||||
assert_equal 42, h.weekly_every_x_week, "should be passed to WeeklyRecurrencePattern"
|
||||
assert_equal 42, h.monthly_every_x_day, "should be passed to MonthlyRecurrencePattern"
|
||||
assert_equal 42, h.yearly_every_x_day, "should be passed to YearlyRecurrencePattern"
|
||||
assert h.on_monday, "should be passed to WeeklyRecurrencePattern"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ require 'test_helper'
|
|||
|
||||
module RecurringTodos
|
||||
|
||||
class MonthlyRepeatPatternTest < ActiveSupport::TestCase
|
||||
class MonthlyRecurrencePatternTest < ActiveSupport::TestCase
|
||||
fixtures :users
|
||||
|
||||
def setup
|
||||
|
|
@ -13,7 +13,7 @@ module RecurringTodos
|
|||
def test_attribute_mapping
|
||||
builder = RecurringTodosBuilder.new(@admin, {
|
||||
'recurring_period' => 'monthly',
|
||||
'description' => 'a repeating todo', # generic
|
||||
'description' => 'a recurring todo', # generic
|
||||
'recurring_target' => 'show_from_date',
|
||||
'ends_on' => 'ends_on_end_date',
|
||||
'end_date' => Time.zone.now + 1.week,
|
||||
|
|
@ -28,7 +28,7 @@ module RecurringTodos
|
|||
assert builder.save, "should save: #{builder.errors.full_messages}"
|
||||
rt = builder.saved_recurring_todo
|
||||
|
||||
assert builder.pattern.is_a?(MonthlyRepeatPattern), "should be monthly pattern, but is #{builder.pattern.class}"
|
||||
assert builder.pattern.is_a?(MonthlyRecurrencePattern), "should be monthly pattern, but is #{builder.pattern.class}"
|
||||
assert builder.pattern.every_x_day?, "should be true for monthly_every_x_day"
|
||||
assert 1, rt.recurrence_selector
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ module RecurringTodos
|
|||
def test_every_x_month
|
||||
builder = RecurringTodosBuilder.new(@admin, {
|
||||
'recurring_period' => 'monthly',
|
||||
'description' => 'a repeating todo', # generic
|
||||
'description' => 'a recurring todo', # generic
|
||||
'recurring_target' => 'show_from_date',
|
||||
'ends_on' => 'ends_on_end_date',
|
||||
'end_date' => Time.zone.now + 1.week,
|
||||
|
|
@ -61,7 +61,7 @@ module RecurringTodos
|
|||
|
||||
builder = RecurringTodosBuilder.new(@admin, {
|
||||
'recurring_period' => 'monthly',
|
||||
'description' => 'a repeating todo', # generic
|
||||
'description' => 'a recurring todo', # generic
|
||||
'recurring_target' => 'show_from_date',
|
||||
'ends_on' => 'ends_on_end_date',
|
||||
'end_date' => Time.zone.now + 1.week,
|
||||
|
|
@ -17,7 +17,7 @@ module RecurringTodos
|
|||
def test_filter_non_daily_attributes
|
||||
attributes = {
|
||||
'recurring_period' => 'monthly',
|
||||
'description' => 'a repeating todo', # generic
|
||||
'description' => 'a recurring todo', # generic
|
||||
'monthly_selector' => 'monthly_every_x_day', # monthly specific
|
||||
'monthly_every_x_day' => 5, # should be preserved as :every_other1
|
||||
'bla_bla' => 'go away' # irrelevant for daily
|
||||
|
|
@ -54,7 +54,7 @@ module RecurringTodos
|
|||
def test_mapping_of_attributes
|
||||
attributes = Tracks::AttributeHandler.new(@admin, {
|
||||
'recurring_period' => 'monthly',
|
||||
'description' => 'a repeating todo', # generic
|
||||
'description' => 'a recurring todo', # generic
|
||||
'monthly_selector' => 'monthly_every_x_day', # monthly specific
|
||||
'monthly_every_x_day' => '5', # mapped to :every_other1
|
||||
'monthly_every_xth_day' => '7', # mapped to :every_other3
|
||||
|
|
@ -75,7 +75,7 @@ module RecurringTodos
|
|||
|
||||
attributes = Tracks::AttributeHandler.new(@admin, {
|
||||
'recurring_period' => 'monthly',
|
||||
'description' => 'a repeating todo', # generic
|
||||
'description' => 'a recurring todo', # generic
|
||||
'monthly_selector' => 'monthly_every_xth_day', # monthly specific
|
||||
'monthly_every_x_day' => '5', # mapped to :every_other1
|
||||
'monthly_every_x_month' => '10', # not mapped
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ require 'test_helper'
|
|||
|
||||
module RecurringTodos
|
||||
|
||||
class WeeklyRepeatPatternTest < ActiveSupport::TestCase
|
||||
class WeeklyRecurrencePatternTest < ActiveSupport::TestCase
|
||||
fixtures :users
|
||||
|
||||
def setup
|
||||
|
|
@ -17,7 +17,7 @@ module RecurringTodos
|
|||
def test_filter_non_daily_attributes
|
||||
attributes = {
|
||||
'recurring_period' => 'weekly',
|
||||
'description' => 'a repeating todo', # generic
|
||||
'description' => 'a recurring todo', # generic
|
||||
'weekly_return_monday' => 'm', # weekly specific
|
||||
'bla_bla' => 'go away' # irrelevant
|
||||
}
|
||||
|
|
@ -27,13 +27,13 @@ module RecurringTodos
|
|||
assert_nil result.get('bla_bla'), "bla_bla should be filtered"
|
||||
assert_nil result.get(:bla_bla), "bla_bla should be filtered"
|
||||
assert_equal ' m ', result.get(:every_day), "weekly attributes should be preserved"
|
||||
assert_equal "a repeating todo", result.get(:description), "description should be preserved"
|
||||
assert_equal "a recurring todo", result.get(:description), "description should be preserved"
|
||||
end
|
||||
|
||||
def test_attributes_to_filter
|
||||
attributes = Tracks::AttributeHandler.new(@admin, {
|
||||
'recurring_period' => 'weekly',
|
||||
'description' => 'a repeating todo', # generic
|
||||
'description' => 'a recurring todo', # generic
|
||||
'weekly_return_monday' => 'm', # weekly specific
|
||||
})
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ module RecurringTodos
|
|||
def test_mapping_of_attributes
|
||||
attributes = Tracks::AttributeHandler.new(@admin, {
|
||||
'recurring_period' => 'weekly',
|
||||
'description' => 'a repeating todo', # generic
|
||||
'description' => 'a recurring todo', # generic
|
||||
'weekly_every_x_week' => '5', # mapped to every_other1
|
||||
'weekly_return_monday' => 'm'
|
||||
})
|
||||
|
|
@ -60,7 +60,7 @@ module RecurringTodos
|
|||
def test_map_day
|
||||
attributes = Tracks::AttributeHandler.new(@admin, {
|
||||
'recurring_period' => 'weekly',
|
||||
'description' => 'a repeating todo', # generic
|
||||
'description' => 'a recurring todo', # generic
|
||||
'weekly_every_x_week' => '5' # mapped to every_other1
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ require 'test_helper'
|
|||
|
||||
module RecurringTodos
|
||||
|
||||
class YearlyRepeatPatternTest < ActiveSupport::TestCase
|
||||
class YearlyRecurrencePatternTest < ActiveSupport::TestCase
|
||||
fixtures :users
|
||||
|
||||
def setup
|
||||
|
|
@ -13,7 +13,7 @@ module RecurringTodos
|
|||
def test_attribute_mapping
|
||||
builder = RecurringTodosBuilder.new(@admin, {
|
||||
'recurring_period' => 'yearly',
|
||||
'description' => 'a repeating todo', # generic
|
||||
'description' => 'a recurring todo', # generic
|
||||
'recurring_target' => 'show_from_date',
|
||||
'ends_on' => 'ends_on_end_date',
|
||||
'end_date' => Time.zone.now + 1.week,
|
||||
|
|
@ -30,7 +30,7 @@ module RecurringTodos
|
|||
assert builder.save, "should save: #{builder.errors.full_messages}"
|
||||
rt = builder.saved_recurring_todo
|
||||
|
||||
assert builder.pattern.is_a?(YearlyRepeatPattern), "should be yearly pattern, but is #{builder.pattern.class}"
|
||||
assert builder.pattern.is_a?(YearlyRecurrencePattern), "should be yearly pattern, but is #{builder.pattern.class}"
|
||||
|
||||
assert_equal rt.recurrence_selector, builder.pattern.recurrence_selector
|
||||
assert_equal rt.every_other2, builder.pattern.month_of_year
|
||||
|
|
@ -17,7 +17,7 @@ module RecurringTodos
|
|||
def test_filter_non_daily_attributes
|
||||
attributes = {
|
||||
'recurring_period' => 'yearly',
|
||||
'description' => 'a repeating todo', # generic
|
||||
'description' => 'a recurring todo', # generic
|
||||
'yearly_selector' => 'yearly_every_x_day', # daily specific
|
||||
'yearly_month_of_year' => '1', # mapped to evert_other2 because yearly_selector is yearly_every_x_day
|
||||
'bla_bla' => 'go away' # irrelevant for daily
|
||||
|
|
@ -28,7 +28,7 @@ module RecurringTodos
|
|||
assert_nil result.get('bla_bla'), "bla_bla should be filtered"
|
||||
assert_nil result.get(:bla_bla), "bla_bla should be filtered"
|
||||
assert_equal '1', result.get(:every_other2), "yearly attributes should be preserved"
|
||||
assert_equal "a repeating todo", result.get(:description), "description should be preserved"
|
||||
assert_equal "a recurring todo", result.get(:description), "description should be preserved"
|
||||
end
|
||||
|
||||
def test_valid_selector
|
||||
|
|
@ -55,7 +55,7 @@ module RecurringTodos
|
|||
def test_mapping_of_attributes
|
||||
attributes = {
|
||||
'recurring_period' => 'yearly',
|
||||
'description' => 'a repeating todo', # generic
|
||||
'description' => 'a recurring todo', # generic
|
||||
'yearly_selector' => 'yearly_every_x_day', # yearly specific
|
||||
'yearly_every_x_day' => '5', # mapped to every_other1
|
||||
'yearly_every_xth_day' => '7', # mapped to every_other3
|
||||
|
|
@ -73,7 +73,7 @@ module RecurringTodos
|
|||
|
||||
attributes = {
|
||||
'recurring_period' => 'yearly',
|
||||
'description' => 'a repeating todo', # generic
|
||||
'description' => 'a recurring todo', # generic
|
||||
'yearly_selector' => 'yearly_every_xth_day', # daily specific --> mapped to only_work_days=false
|
||||
'yearly_month_of_year' => '1', # ignored because yearly_selector is yearly_every_xth_day
|
||||
'yearly_month_of_year2' => '2' # mapped to evert_other2 because yearly_selector is yearly_every_xth_day
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ class UserTest < ActiveSupport::TestCase
|
|||
assert_equal expect_todos_count, Todo.count, "expected #{nr_of_todos} todos to be gone"
|
||||
assert_equal expect_projects_count, Project.count, "expected #{nr_of_projects} projects to be gone"
|
||||
assert_equal expect_contexts_count, Context.count, "expected #{nr_of_contexts} contexts to be gone"
|
||||
assert_equal expect_rec_todos_count, RecurringTodo.count, "expected #{nr_of_rec_todos} repeating todos to be gone"
|
||||
assert_equal expect_rec_todos_count, RecurringTodo.count, "expected #{nr_of_rec_todos} recurring todos to be gone"
|
||||
assert_equal expect_notes_count, Note.count, "expected #{nr_of_notes} notes to be gone"
|
||||
assert_equal expect_deps_count, Dependency.count, "expected #{nr_of_deps} dependencies to be gone"
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue