Update tests for PR #589

This commit is contained in:
Ben Atkins 2015-08-11 21:37:50 -04:00
parent 4f1b2b6645
commit a53d6e43cb
3 changed files with 6 additions and 6 deletions

View File

@ -51,8 +51,8 @@ describe Widget, :type => :model do
describe :after_create do
let(:widget) { Widget.create!(:name => 'Foobar', :created_at => Time.now - 1.week) }
it "corresponding version should use the widget's `created_at`" do
expect(widget.versions.last.created_at.to_i).to eq(widget.created_at.to_i)
it "corresponding version should use the widget's `updated_at`" do
expect(widget.versions.last.created_at.to_i).to eq(widget.updated_at.to_i)
end
end

View File

@ -1,8 +1,8 @@
class SetUpTestTables < ActiveRecord::Migration
def self.up
create_table :skippers, :force => true do |t|
t.string :name
t.datetime :another_timestamp
t.string :name
t.datetime :another_timestamp
t.timestamps :null => true
end

View File

@ -212,8 +212,8 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase
assert @widget.live?
end
should 'use the widget created_at' do
assert_equal @widget.created_at.to_i, @widget.versions.first.created_at.to_i
should "use the widget `updated_at` as the version's `created_at`" do
assert_equal @widget.updated_at.to_i, @widget.versions.first.created_at.to_i
end
should 'have changes' do