Sha256: 1b849347b5ab3851700a644a9c78c4f0ce2a5d2a745478091ed97f928e801a3b
Contents?: true
Size: 646 Bytes
Versions: 19
Compression:
Stored size: 646 Bytes
Contents
require File.expand_path(File.join(File.dirname(__FILE__), "/../../spec_helper.rb")) describe Mongoid::Timestamps do describe "#included" do before do @person = Person.new end it "adds created_at and modified_at to the document" do fields = Person.instance_variable_get(:@fields) fields[:created_at].should_not be_nil fields[:modified_at].should_not be_nil end it "forces the timestamps to UTC" do @person.run_callbacks(:before_save) @person.created_at.should be_close(Time.now.utc, 10.seconds) @person.modified_at.should be_close(Time.now.utc, 10.seconds) end end end
Version data entries
19 entries across 19 versions & 1 rubygems