Skip to content

Commit

Permalink
Update tests for PR #589
Browse files Browse the repository at this point in the history
  • Loading branch information
batter committed Aug 12, 2015
1 parent 4f1b2b6 commit a53d6e4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions spec/models/widget_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
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

Expand Down
4 changes: 2 additions & 2 deletions test/dummy/db/migrate/20110208155312_set_up_test_tables.rb
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/unit/model_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a53d6e4

Please sign in to comment.