features/step_definitions/common_steps.rb in thinking-sphinx-2.0.7 vs features/step_definitions/common_steps.rb in thinking-sphinx-2.0.8

- old
+ new

@@ -93,12 +93,16 @@ else @with[attribute.to_sym] = first.to_f..last.to_f end end -When /^I filter between (\d+) and (\d+) days ago on (\w+)$/ do |last, first, attribute| +When /^I filter between (\d+) and (\d+) days ago on (\w+)(?: by (date))?$/ do |last, first, attribute, by_date| @results = nil - @with[attribute.to_sym] = first.to_i.days.ago..last.to_i.days.ago + + first, last = first.to_i.days.ago, last.to_i.days.ago + first, last = first.to_date, last.to_date if by_date + + @with[attribute.to_sym] = first..last end When /^I filter by (\w+) between (\d+) and (\d+)$/ do |attribute, first, last| @results = nil @with[attribute.to_sym] = Time.utc(first.to_i)..Time.utc(last.to_i)