added post voting

This commit is contained in:
albert
2010-02-15 17:45:09 -05:00
parent 80f033f253
commit 9f353c32f4
10 changed files with 112 additions and 19 deletions

View File

@@ -38,7 +38,7 @@ class CommentTest < ActiveSupport::TestCase
post = Factory.create(:post)
c1 = Factory.create(:comment, :post => post)
assert_nothing_raised {c1.vote!(user, true)}
assert_raise(Comment::VotingError) {c1.vote!(user, true)}
assert_raise(CommentVote::Error) {c1.vote!(user, true)}
assert_equal(1, CommentVote.count)
c2 = Factory.create(:comment, :post => post)