mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-13 18:55:45 -04:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user