spec/timeago/helper_spec.rb in rails-timeago-2.2.2 vs spec/timeago/helper_spec.rb in rails-timeago-2.2.3

- old
+ new

@@ -117,9 +117,18 @@ end it "should return default string if time is nil" do @stub.timeago_tag(nil).should == '-' end + + it 'should respect limit option also in nojs tag content' do + time = 6.days.ago + + @stub.timeago_tag(time, :nojs => true, :limit => 5.days.ago). + should_not =~ /<time.*data-time-ago=".*".*>.*<\/time>/ + @stub.timeago_tag(time, :nojs => true, :limit => 5.days.ago). + should include(">#{I18n.l time.to_date}<") + end end context "#timeago_script_tag" do it "should return a javascript snippet to set jQuery timeago locale" do I18n.locale = "en"