tests: fixup tests.

This commit is contained in:
evazion
2019-09-09 11:51:01 -05:00
parent efca48ee96
commit d812a19902
6 changed files with 12 additions and 10 deletions

View File

@@ -17,12 +17,11 @@ class CommentVotesControllerTest < ActionDispatch::IntegrationTest
context "#create.json" do
should "create a vote" do
assert_difference("CommentVote.count", 1) do
post_auth comment_votes_path(comment_id: @comment.id, score: "down", format: "json"), @user
post_auth comment_votes_path(comment_id: @comment.id, score: "down"), @user, as: :json
assert_response :success
comment = JSON.parse(@response.body)
assert_equal(@comment.id, comment["id"])
assert_equal(-1, comment["score"])
assert_equal(@comment.id, response.parsed_body["id"])
assert_equal(-1, response.parsed_body["score"])
end
end