occurence -> occurrence

This commit is contained in:
Carsten Otto 2015-02-10 15:49:13 +01:00
parent d1cd4b68eb
commit d480569629
14 changed files with 50 additions and 44 deletions

View file

@ -47,7 +47,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
"monthly_every_xth_day"=>"1",
"monthly_selector"=>"monthly_every_x_day",
"notes"=>"with some notes",
"number_of_occurences" => "",
"number_of_occurrences" => "",
"recurring_period"=>"yearly",
"recurring_show_days_before"=>"10",
"recurring_target"=>"due_date",
@ -91,7 +91,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
"monthly_every_xth_day"=>"1",
"monthly_selector"=>"monthly_every_x_day",
"notes"=>"with some notes",
"number_of_occurences" => "",
"number_of_occurrences" => "",
"recurring_period"=>"yearly",
"recurring_show_days_before"=>"10",
"recurring_target"=>"due_date",
@ -141,7 +141,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
"monthly_every_xth_day"=>"1",
"monthly_selector"=>"monthly_every_x_day",
"notes"=>"with some notes",
"number_of_occurences" => "",
"number_of_occurrences" => "",
"recurring_period"=>"yearly",
"recurring_show_days_before"=>"10",
"recurring_target"=>"due_date",
@ -255,7 +255,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
"monthly_every_xth_day"=>"1",
"monthly_selector"=>"monthly_every_x_day",
"notes"=>"with some notes",
"number_of_occurences" => "",
"number_of_occurrences" => "",
"recurring_period"=>"yearly",
"recurring_show_days_before"=>"0",
"recurring_target"=>"due_date",
@ -309,7 +309,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
"monthly_every_xth_day"=>"1",
"monthly_selector"=>"monthly_every_x_day",
"notes"=>"with some notes",
"number_of_occurences" => "",
"number_of_occurrences" => "",
"recurring_period"=>"yearly",
"recurring_show_always"=>"1",
"recurring_show_days_before"=>"0",
@ -361,7 +361,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
"monthly_every_xth_day"=>"1",
"monthly_selector"=>"monthly_every_x_day",
"notes"=>"with some notes",
"number_of_occurences" => nil,
"number_of_occurrences" => nil,
"recurring_period"=>"monthly",
"recurring_show_days_before"=>"0",
"recurring_target"=>"show_from_date",

View file

@ -36,7 +36,7 @@ call_bill_gates_every_day:
start_from: <%= way_back %>
ends_on: no_end_date
end_date: ~
number_of_occurences: ~
number_of_occurrences: ~
target: due_date
show_from_delta: ~
recurring_period: daily
@ -63,7 +63,7 @@ call_bill_gates_every_workday:
start_from: ~
ends_on: no_end_date
end_date: ~
number_of_occurences: ~
number_of_occurrences: ~
target: due_date
show_from_delta: ~
show_always: false
@ -90,7 +90,7 @@ call_bill_gates_every_week:
start_from: <%= way_back %>
ends_on: no_end_date
end_date: ~
number_of_occurences: ~
number_of_occurrences: ~
target: due_date
show_from_delta: 5
recurring_period: weekly
@ -117,7 +117,7 @@ check_with_bill_every_last_friday_of_month:
start_from: <%= way_back %>
ends_on: no_end_date
end_date: ~
number_of_occurences: ~
number_of_occurrences: ~
target: due_date
show_from_delta: 5
recurring_period: monthly
@ -144,7 +144,7 @@ birthday_reinier:
start_from: <%= way_back %>
ends_on: no_end_date
end_date: ~
number_of_occurences: ~
number_of_occurrences: ~
target: due_date
show_from_delta: 5
show_always: false

View file

@ -151,21 +151,21 @@ class RecurringTodoTest < ActiveSupport::TestCase
assert @yearly.starred?
end
def test_occurence_count
@every_day.number_of_occurences = 2
def test_occurrence_count
@every_day.number_of_occurrences = 2
assert_equal true, @every_day.continues_recurring?(@in_three_days)
@every_day.increment_occurrences
assert_equal true, @every_day.continues_recurring?(@in_three_days)
@every_day.increment_occurrences
assert_equal false, @every_day.continues_recurring?(@in_three_days)
# after completion, when you reactivate the recurring todo, the occurences
# after completion, when you reactivate the recurring todo, the occurrences
# count should be reset
assert_equal 2, @every_day.occurences_count
assert_equal 2, @every_day.occurrences_count
assert @every_day.toggle_completion!
assert @every_day.toggle_completion!
assert_equal true, @every_day.continues_recurring?(@in_three_days)
assert_equal 0, @every_day.occurences_count
assert_equal 0, @every_day.occurrences_count
end
end

View file

@ -73,7 +73,7 @@ module RecurringTodos
assert pattern.valid?, "should be valid"
end
def test_validation_on_number_of_occurences
def test_validation_on_number_of_occurrences
attributes = {
'weekly_return_monday' => 'm', # weekly specific
'weekly_every_x_week' => 1,
@ -83,9 +83,9 @@ module RecurringTodos
}
# pattern = create_recurring_todo(attributes)
# assert !pattern.valid?, "number_of_occurences should be filled"
# assert !pattern.valid?, "number_of_occurrences should be filled"
attributes['number_of_occurences']=5
attributes['number_of_occurrences']=5
pattern = create_recurring_todo(attributes)
assert pattern.valid?, "should be valid"
end
@ -110,12 +110,12 @@ module RecurringTodos
assert !rt.continues_recurring?(Time.zone.now), "should end because end_date is in the past"
rt.reload # reset
rt.number_of_occurences = 2
rt.occurences_count = 1
assert rt.continues_recurring?(Time.zone.now), "should continue since there still may come occurences"
rt.number_of_occurrences = 2
rt.occurrences_count = 1
assert rt.continues_recurring?(Time.zone.now), "should continue since there still may come occurrences"
rt.occurences_count = 2
assert !rt.continues_recurring?(Time.zone.now), "should end since all occurences are there"
rt.occurrences_count = 2
assert !rt.continues_recurring?(Time.zone.now), "should end since all occurrences are there"
end
def test_determine_start