Permalink
Browse files

Fix a lying test about not listing drafts

  • Loading branch information...
1 parent 7900c34 commit d60c9d9bac69cc7dda982d09126812c2dd6c267a @jmorton jmorton committed Mar 24, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 test/functional/posts_controller_test.rb
@@ -21,11 +21,15 @@ def valid_post_attributes
def test_anyone_can_list_the_posts
get :index
+ published = posts('codename-obtvse')
+ assert assigns(:posts).include?(published), 'Posts should include published posts'
assert_response :ok
end
def test_spies_cannot_spy_by_listing_drafts
get :index
+ draft = posts('a-modest-proposal')
+ assert ! assigns(:posts).include?(draft), 'Posts should not include drafts'
assert_response :ok
end

0 comments on commit d60c9d9

Please sign in to comment.