test/undo_test.rb in mongoid-undo-1.0.0 vs test/undo_test.rb in mongoid-undo-1.1.0
- old
+ new
@@ -13,22 +13,22 @@
class Timestamped < Document
include Mongoid::Timestamps
end
-class UndoTest < Minitest::Unit::TestCase
+class UndoTest < Minitest::Test
def test_create
document = Document.create(name: 'foo')
assert_equal :create, document.action
assert_equal 1, document.version
assert document.persisted?
assert document.undoable?
document.undo
assert_equal :create, document.action
assert_equal 1, document.version
- assert_not document.persisted?
+ refute document.persisted?
assert document.undoable?
document.redo
assert_equal :create, document.action
assert_equal 1, document.version
@@ -39,11 +39,11 @@
def test_update
document = Document.create(name: 'foo')
document.save
- assert_not document.undoable?
+ refute document.undoable?
document.update_attributes name: 'bar'
assert_equal :update, document.action
assert_equal 2, document.version
assert_equal 'bar', document.name
@@ -67,21 +67,21 @@
def test_destroy
document = Document.create(name: 'foo')
document.destroy
assert_equal :destroy, document.action
- assert_not document.persisted?
+ refute document.persisted?
assert document.undoable?
document.undo
assert_equal :destroy, document.action
assert document.persisted?
assert document.undoable?
document.redo
assert_equal :destroy, document.action
- assert_not document.persisted?
+ refute document.persisted?
assert document.undoable?
end
def test_redo_equals_to_undo
@@ -113,16 +113,16 @@
def test_updated_at_timestamp
document = Timestamped.create(name: 'foo')
updated_at = document.updated_at
document.update_attributes(name: 'bar')
- assert_not_equal updated_at, document.updated_at
+ refute_equal updated_at, document.updated_at
document.undo
- assert_not_equal updated_at, document.updated_at
+ refute_equal updated_at, document.updated_at
document.redo
- assert_not_equal updated_at, document.updated_at
+ refute_equal updated_at, document.updated_at
end
def test_callbacks
document = Document.create(name: 'foo')