Permalink
Browse files

Test that uuid should be reassignable.

  • Loading branch information...
1 parent e7ea862 commit a9030ed866d76234ed2071ce271897690ca0107e @tfe tfe committed Feb 20, 2009
Showing with 15 additions and 0 deletions.
  1. +15 −0 test/has_uuid_test.rb
View
@@ -74,4 +74,19 @@ def test_should_always_assign_uuid_when_forced
assert_not_equal(original_uuid, @widget.uuid)
end
+ def test_uuid_should_be_reassignable
+ @widget = Widget.new
+ @widget.save
+ @widget.reload
+ assert @widget.uuid_valid?
+
+ new_uuid = UUID.random_create.to_s
+ @widget.uuid = new_uuid
+ @widget.save
+ @widget.reload
+ assert @widget.uuid_valid?
+ assert_equal(new_uuid, @widget.uuid)
+ end
+
+
end

0 comments on commit a9030ed

Please sign in to comment.