Skip to content

Commit

Permalink
Improved to_param tests for Post.
Browse files Browse the repository at this point in the history
  • Loading branch information
nakajima committed Feb 8, 2009
1 parent d43f11f commit 70100b1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/unit/post_test.rb
Expand Up @@ -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)
Expand Down

0 comments on commit 70100b1

Please sign in to comment.