additional functional tests, some controller fixes

This commit is contained in:
albert
2010-12-01 18:50:04 -05:00
parent 39dd2e277a
commit 976a25a6c6
19 changed files with 185 additions and 27 deletions

View File

@@ -1,8 +1,24 @@
require 'test_helper'
class CommentVotesControllerTest < ActionController::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
context "A comment votes controller" do
setup do
CurrentUser.user = Factory.create(:user)
CurrentUser.ip_addr = "127.0.0.1"
@comment = Factory.create(:comment)
@user = Factory.create(:user)
end
teardown do
CurrentUser.user = nil
CurrentUser.ip_addr = nil
end
should "create a vote" do
assert_difference("CommentVote.count", 1) do
post :create, {:format => "js", :comment_id => @comment.id}, {:user_id => @user.id}
assert_response :success
end
end
end
end