mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-03 22:41:48 +01:00
occurence -> occurrence
This commit is contained in:
parent
d1cd4b68eb
commit
d480569629
14 changed files with 50 additions and 44 deletions
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue