From abb9acd04a0e73b8fa97a23d2a6ecde2ddc6059d Mon Sep 17 00:00:00 2001 From: Miles Gould Date: Mon, 19 Dec 2016 16:40:05 +0000 Subject: [PATCH] post_spec: fix warnings Several "unused variable" warnings (due to replacing unused instance variables with unused locals) and one warning about ambiguous lack-of-brackets. --- spec/models/post_spec.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb index e73435162..bed466d71 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -29,22 +29,22 @@ describe Post do it "has many comments" do post = FactoryGirl.create(:post, author: member) - comment1 = FactoryGirl.create(:comment, post: post) - comment2 = FactoryGirl.create(:comment, post: post) + FactoryGirl.create(:comment, post: post) + FactoryGirl.create(:comment, post: post) post.comments.size.should == 2 end it "supports counting comments" do post = FactoryGirl.create(:post, author: member) - comment1 = FactoryGirl.create(:comment, post: post) - comment2 = FactoryGirl.create(:comment, post: post) + FactoryGirl.create(:comment, post: post) + FactoryGirl.create(:comment, post: post) post.comment_count.should == 2 end it "destroys comments when deleted" do post = FactoryGirl.create(:post, author: member) - comment1 = FactoryGirl.create(:comment, post: post) - comment2 = FactoryGirl.create(:comment, post: post) + FactoryGirl.create(:comment, post: post) + FactoryGirl.create(:comment, post: post) post.comments.size.should == 2 all = Comment.count post.destroy @@ -124,7 +124,7 @@ describe Post do n = Notification.first n.sender.should eq member n.recipient.should eq member2 - n.subject.should match /mentioned you in their post/ + n.subject.should match(/mentioned you in their post/) n.body.should eq p.body end