forum post votes: add index page.

This commit is contained in:
evazion
2019-10-28 01:06:23 -05:00
parent d617b20b49
commit 0e159960a2
10 changed files with 92 additions and 19 deletions
+5 -1
View File
@@ -1,3 +1,7 @@
FactoryBot.define do
factory(:forum_post_vote)
factory(:forum_post_vote) do
creator
forum_post
score { [-1, 0, 1].sample }
end
end
@@ -0,0 +1,22 @@
require 'test_helper'
class ForumPostVotesControllerTest < ActionDispatch::IntegrationTest
context "The forum post votes controller" do
setup do
@user = create(:user)
as(@user) do
@forum_topic = create(:forum_topic)
@forum_post = create(:forum_post, topic: @forum_topic)
@forum_post_vote = create(:forum_post_vote, creator: @user, forum_post: @forum_post)
end
end
context "index action" do
should "render" do
get forum_post_votes_path
assert_response :success
end
end
end
end