spec/timeago/helper_spec.rb in rails-timeago-2.9.0 vs spec/timeago/helper_spec.rb in rails-timeago-2.10.0

- old
+ new

@@ -73,9 +73,24 @@ it 'should have not data-time-ago attribute for times before given limit' do @stub.timeago_tag(6.days.ago, :limit => 5.days.ago). should_not =~ /<time.*data-time-ago=".*".*>.*<\/time>/ end + it 'should have data-time-ago attribute for times before given limit if limit is in the future' do + @stub.timeago_tag(5.days.from_now, :limit => 6.days.from_now). + should =~ /<time.*data-time-ago=".*".*>.*<\/time>/ + end + + it 'should have not data-time-ago attribute for times in the past if limit is in the future' do + @stub.timeago_tag(1.days.ago, :limit => 5.days.from_now). + should_not =~ /<time.*data-time-ago=".*".*>.*<\/time>/ + end + + it 'should have not data-time-ago attribute for times after given limit if limit is in the future' do + @stub.timeago_tag(6.days.from_now, :limit => 5.days.from_now). + should_not =~ /<time.*data-time-ago=".*".*>.*<\/time>/ + end + it 'should have data-time-ago attribute for times before limit if forced' do @stub.timeago_tag(6.days.ago, :force => true). should =~ /<time.*data-time-ago=".*".*>.*<\/time>/ end