Permalink
Browse files

Improved to_param tests for Post.

  • Loading branch information...
1 parent d43f11f commit 70100b1dd7b715665f6c4b7c8b803acf900a2726 @nakajima committed Feb 8, 2009
Showing with 7 additions and 2 deletions.
  1. +7 −2 test/unit/post_test.rb
@@ -26,10 +26,15 @@ def test_should_create_with_only_feed_id
end
end
- def test_should_override_to_param
- post = create_post
+ def test_should_override_to_param_as_permalink_for_non_feeds
+ post = create_post :feed_id => nil
assert_equal post.permalink, post.to_param
end
+
+ def test_should_override_to_param_as_id_for_feeds
+ post = create_post :feed_id => 1
+ assert_equal post.id.to_s, post.to_param
+ end
def test_should_be_deleted_not_destroyed
post = posts(:one)

0 comments on commit 70100b1

Please sign in to comment.