additional checks on forum topic visibility

This commit is contained in:
Albert Yi
2016-11-04 16:24:54 -07:00
parent a22a7c3302
commit eb6746a8a8
9 changed files with 35 additions and 11 deletions

View File

@@ -45,6 +45,7 @@ class ForumPostsControllerTest < ActionController::TestCase
context "with private topics" do
setup do
CurrentUser.user = @mod
@mod_topic = FactoryGirl.create(:mod_up_forum_topic)
@mod_posts = 2.times.map do
FactoryGirl.create(:forum_post, :topic_id => @mod_topic.id)
@@ -53,6 +54,7 @@ class ForumPostsControllerTest < ActionController::TestCase
end
should "list only permitted posts for members" do
CurrentUser.user = @user
get :index, {}, { :user_id => @user.id }
assert_response :success