tests: fixup tests.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class ForumTopicsControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
should "not allow users to see the topic" do
|
||||
get_auth forum_topic_path(@forum_topic), @user
|
||||
assert_redirected_to forum_topics_path
|
||||
assert_response 403
|
||||
end
|
||||
|
||||
should "not bump the forum for users without access" do
|
||||
|
||||
@@ -87,7 +87,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
|
||||
get_auth profile_path, @user, as: :json
|
||||
assert_response :success
|
||||
|
||||
assert_equal(@user.upload_limit, response.parsed_body["upload_limit"])
|
||||
assert_equal(@user.comment_count, response.parsed_body["comment_count"])
|
||||
end
|
||||
|
||||
should "redirect anonymous users to the sign in page" do
|
||||
|
||||
Reference in New Issue
Block a user