Changeset 4646
- Timestamp:
- 08/01/06 07:33:17 (2 years ago)
- Files:
-
- trunk/activerecord/test/base_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/test/base_test.rb
r4626 r4646 324 324 end 325 325 end 326 326 327 327 def test_destroy 328 topic = Topic.new 329 topic.title = "Yet Another New Topic" 330 topic.written_on = "2003-12-12 23:23:00" 331 topic.save 332 topic.destroy 328 topic = Topic.find(1) 329 assert_equal topic, topic.destroy, 'topic.destroy did not return self' 330 assert topic.frozen?, 'topic not frozen after destroy' 333 331 assert_raise(ActiveRecord::RecordNotFound) { Topic.find(topic.id) } 334 332 end 335 336 def test_destroy_returns_self 337 topic = Topic.new("title" => "Yet Another Title") 338 assert topic.save 339 assert_equal topic, topic.destroy, "destroy did not return destroyed object" 340 end 341 333 342 334 def test_record_not_found_exception 343 335 assert_raises(ActiveRecord::RecordNotFound) { topicReloaded = Topic.find(99999) }