/posts.atom: fix banned posts being visible to Members.

Bug: /posts.atom only hid loli/shota, not banned posts and not unsafe
posts when safe mode was on.
This commit is contained in:
evazion
2019-08-25 20:29:32 -05:00
parent 0101b5f5f4
commit 62875eabb2
3 changed files with 26 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
context "The posts controller" do
setup do
PopularSearchService.stubs(:enabled?).returns(false)
@user = travel_to(1.month.ago) {create(:user)}
as_user do
@post = create(:post, :tag_string => "aaaa")
@@ -92,6 +92,30 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
assert_response :success
end
end
context "with the .atom format" do
should "render without tags" do
get posts_path(format: :atom)
assert_response :success
assert_select "entry", 1
end
should "render with tags" do
get posts_path(format: :atom), params: { tags: "aaaa" }
assert_response :success
assert_select "entry", 1
end
should "hide restricted posts" do
@post.update(is_banned: true)
get posts_path(format: :atom)
assert_response :success
assert_select "entry", 0
end
end
end
context "show_seq action" do