spec/controllers/comments_controller_spec.rb in almanac-0.7.4 vs spec/controllers/comments_controller_spec.rb in almanac-0.8.0

- old
+ new

@@ -46,6 +46,21 @@ it "redirects to the post" do delete :destroy, :use_route => :almanac, id: @comment.id, :post_id => @post.id response.should redirect_to @post end end + + describe "GET spam" do + before :each do + post = create(:post_with_comments, comments_count: 10, blog_id: @post.blog.id) + @spam_comments = create_list(:spam_comment, 5, post_id: post.id) + end + it "returns spam comments" do + get :spam, :use_route => :almanac, id: @post.blog.id + assigns(:comments).should eq(@spam_comments) + end + it "renders the spam page" do + get :spam, :use_route => :almanac, id: @post.blog.id + response.should render_template :spam + end + end end \ No newline at end of file