mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-16 22:25:28 +01:00
add basis tests for patterns and remove doubles from recurring_todo_test.rb
This commit is contained in:
parent
a7807a4b66
commit
cbdbb792a5
9 changed files with 212 additions and 111 deletions
|
|
@ -51,6 +51,10 @@ module RecurringTodos
|
|||
@pattern.attributes
|
||||
end
|
||||
|
||||
def errors
|
||||
@recurring_todo.try(:errors)
|
||||
end
|
||||
|
||||
def attributes_to_filter
|
||||
raise Exception.new, "attributes_to_filter should be overridden"
|
||||
end
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ module RecurringTodos
|
|||
case recurrence_selector
|
||||
when 0 # 'monthly_every_x_day'
|
||||
validate_not_blank(every_x_month, "Every other nth month may not be empty for recurrence setting")
|
||||
when 1 # 'every_xth_day'
|
||||
when 1 # 'monthly_every_xth_day'
|
||||
validate_not_blank(every_x_month2, "Every other nth month may not be empty for recurrence setting")
|
||||
validate_not_blank(day_of_week, "The day of the month may not be empty for recurrence setting")
|
||||
else
|
||||
|
|
|
|||
|
|
@ -51,6 +51,10 @@ module RecurringTodos
|
|||
@builder.pattern
|
||||
end
|
||||
|
||||
def errors
|
||||
@builder.errors
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def valid_selector?(selector)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue