Skip to content

Commit

Permalink
Couple extra tests
Browse files Browse the repository at this point in the history
git-svn-id: http://rubymatt.rubyforge.org/svn/simply_versioned@6 9890f43a-5319-0410-996d-de745e0c2bc8
  • Loading branch information
mmower committed Dec 30, 2007
1 parent b55b4d6 commit 98d55cd
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions test/simply_versioned_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ def test_should_begin_versioning_existing_record
end

ulrica = Undine.find_by_name( 'Ulrica' )
ulrica.update_attributes( :married => 1 )
assert ulrica.unversioned?

ulrica.update_attributes( :married => 1 )
assert !ulrica.unversioned?
assert_equal 1, ulrica.versions.size

assert_equal 1, ulrica.versions.first.model.married
end

Expand All @@ -168,4 +168,17 @@ def test_should_follow_back_and_forth
assert_equal anthony.versions.first_version, anthony.versions.current_version.previous.previous
end

def test_should_be_trustworthy_collection

anthony = Aardvark.create!( :name => 'Anthony', :age => 35 ) # v1
anthony.age += 1
anthony.save! #v2

# Now create another record

alan = Aardvark.create!( :name => 'Alan', :age => 35 )
assert_equal 1, alan.versions.size

end

end

0 comments on commit 98d55cd

Please sign in to comment.