spec/transient_shared_spec.rb in transient-1.0.0 vs spec/transient_shared_spec.rb in transient-1.0.1

- old
+ new

@@ -52,12 +52,25 @@ @instance.should_not be_current @instance.should_not be_expired @instance.should_not be_past @instance.should be_future end + + it "should respond to :effective" do + @klass.respond_to?( :effective ).should be_true + end it "should invoke callbacks around expire!" do @instance.should_receive(:before_expire!) @instance.should_receive(:after_expire!) @instance.expire! + end + + it "should set effective_at to now if it was not explicitly set to something else" do + @instance_no_dates.effective_at.should_not be_nil + end + + it "should not allow records without an effective_at date to be saved" do + @instance_no_dates.effective_at = nil + @instance_no_dates.save.should be_false end end \ No newline at end of file