0
@@ -147,15 +147,15 @@ class VersionedTest < Test::Unit::TestCase
0
p = Page.create! :title => "title"
0
assert_equal 1, p.version # version does not increment
0
- assert_equal 1, p.versions
(true).size0
+ assert_equal 1, p.versions
.count0
p.update_attributes(:title => 'new title')
0
assert_equal 1, p.version # version does not increment
0
- assert_equal 1, p.versions
(true).size0
+ assert_equal 1, p.versions
.count0
p.update_attributes(:title => 'a title')
0
assert_equal 2, p.version
0
- assert_equal 2, p.versions
(true).size0
+ assert_equal 2, p.versions
.count0
# reset original if condition
0
Page.class_eval { alias_method :feeling_good?, :old_feeling_good }
0
@@ -168,15 +168,15 @@ class VersionedTest < Test::Unit::TestCase
0
p = Page.create! :title => "title"
0
assert_equal 1, p.version # version does not increment
0
- assert_equal 1, p.versions
(true).size0
+ assert_equal 1, p.versions
.count0
p.update_attributes(:title => 'a title')
0
assert_equal 1, p.version # version does not increment
0
- assert_equal 1, p.versions
(true).size0
+ assert_equal 1, p.versions
.count0
p.update_attributes(:title => 'b title')
0
assert_equal 2, p.version
0
- assert_equal 2, p.versions
(true).size0
+ assert_equal 2, p.versions
.count0
# reset original if condition
0
Page.version_condition = old_condition
0
@@ -322,25 +322,24 @@ class VersionedTest < Test::Unit::TestCase
0
def test_should_find_version_count
0
assert_equal 2, pages(:welcome).versions.size
0
def test_if_changed_creates_version_if_a_listed_column_is_changed
0
- landmarks(:washington).name
="Washington"
0
+ landmarks(:washington).name
= "Washington"
0
assert landmarks(:washington).changed?
0
assert landmarks(:washington).altered?
0
def test_if_changed_creates_version_if_all_listed_columns_are_changed
0
- landmarks(:washington).name="Washington"
0
- landmarks(:washington).latitude=1.0
0
- landmarks(:washington).longitude=1.0
0
+ landmarks(:washington).name = "Washington"
0
+ landmarks(:washington).latitude = 1.0
0
+ landmarks(:washington).longitude = 1.0
0
assert landmarks(:washington).changed?
0
assert landmarks(:washington).altered?
0
def test_if_changed_does_not_create_new_version_if_unlisted_column_is_changed
0
- landmarks(:washington).doesnt_trigger_version
="This should not trigger version"
0
+ landmarks(:washington).doesnt_trigger_version
= "This should not trigger version"
0
assert landmarks(:washington).changed?
0
assert !landmarks(:washington).altered?
0
\ No newline at end of file
Comments
No one has commented yet.