Sha256: 6e00672a24506c002bba80dbf4ab86c64e7473c98391f03906ff53ae94023c8d
Contents?: true
Size: 758 Bytes
Versions: 3
Compression:
Stored size: 758 Bytes
Contents
require File.dirname(__FILE__) + "/spec_helper" describe "Magic Columns" do it "should update updated_at on save" do zoo = Zoo.new(:name => 'Mary') zoo.save zoo.updated_at.should be_a_kind_of(Time) end it "should not update created_at when updating a model" do section = Section.create(:title => "Mars") old_created_at = section.created_at section.update_attributes(:title => "Mars2!") section.created_at.should eql(old_created_at) end it "should not set the created_at/on fields if already set on creation" do section = Section.new(:title => "Mars") fixed_created_at = Time::now - 2600 section.created_at = fixed_created_at section.save section.created_at.should eql(fixed_created_at) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
datamapper-0.3.0 | spec/magic_columns_spec.rb |
datamapper-0.3.1 | spec/magic_columns_spec.rb |
datamapper-0.3.2 | spec/magic_columns_spec.rb |