From 68c74ed9d8eafc15874386492fdbc19b7917a775 Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 28 Oct 2019 16:52:02 -0500 Subject: [PATCH] tests: fixup post votes, comment votes controller tests. --- test/functional/comment_votes_controller_test.rb | 8 ++++---- test/functional/post_votes_controller_test.rb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/functional/comment_votes_controller_test.rb b/test/functional/comment_votes_controller_test.rb index 3f7b4ef33..d5502f6ac 100644 --- a/test/functional/comment_votes_controller_test.rb +++ b/test/functional/comment_votes_controller_test.rb @@ -17,7 +17,7 @@ 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"), @user, as: :json + post_auth comment_comment_votes_path(comment_id: @comment.id, score: "down"), @user, as: :json assert_response :success assert_equal(@comment.id, response.parsed_body["id"]) @@ -28,7 +28,7 @@ class CommentVotesControllerTest < ActionDispatch::IntegrationTest should "fail silently on errors" do create(:comment_vote, comment: @comment, score: -1) assert_difference("CommentVote.count", 0) do - post_auth comment_votes_path(comment_id: @comment.id, score: "down", format: "json"), @user + post_auth comment_comment_votes_path(comment_id: @comment.id, score: "down", format: "json"), @user assert_response 422 comment = JSON.parse(@response.body) @@ -41,7 +41,7 @@ class CommentVotesControllerTest < ActionDispatch::IntegrationTest context "#create.js" do should "create a vote" do assert_difference("CommentVote.count", 1) do - post_auth comment_votes_path(comment_id: @comment.id, format: "json", score: "down"), @user + post_auth comment_comment_votes_path(comment_id: @comment.id, format: "json", score: "down"), @user assert_response :success end end @@ -49,7 +49,7 @@ class CommentVotesControllerTest < ActionDispatch::IntegrationTest should "fail on errors" do create(:comment_vote, :comment => @comment, :score => -1) assert_difference("CommentVote.count", 0) do - post_auth comment_votes_path(comment_id: @comment.id, :score => "down", format: "js"), @user + post_auth comment_comment_votes_path(comment_id: @comment.id, :score => "down", format: "js"), @user assert_response 422 end end diff --git a/test/functional/post_votes_controller_test.rb b/test/functional/post_votes_controller_test.rb index e4d9e7725..e6e4af466 100644 --- a/test/functional/post_votes_controller_test.rb +++ b/test/functional/post_votes_controller_test.rb @@ -12,7 +12,7 @@ class PostVotesControllerTest < ActionDispatch::IntegrationTest context "index action" do should "work" do as(@user) { create(:post_vote, post_id: @post.id, user_id: @user.id) } - get post_votes_path + get_auth post_votes_path, @user assert_response :success end