add basis tests for patterns and remove doubles from recurring_todo_test.rb

This commit is contained in:
Reinier Balt 2014-02-23 15:13:53 +01:00
parent a7807a4b66
commit cbdbb792a5
9 changed files with 212 additions and 111 deletions

View file

@ -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

View file

@ -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

View file

@ -51,6 +51,10 @@ module RecurringTodos
@builder.pattern
end
def errors
@builder.errors
end
private
def valid_selector?(selector)