Fix: Don't show non-members as readers when the post is a whisper

This commit is contained in:
romanrizzi
2019-09-13 17:14:31 -03:00
parent 1576b07a10
commit 08b7a3fdfe
2 changed files with 32 additions and 5 deletions

View File

@@ -76,6 +76,18 @@ describe PostReadersController do
expect(readers).to be_empty
end
it 'xxxxx' do
@post.update(post_type: Post.types[:whisper])
non_member_reader = Fabricate(:user)
@group_message.allowed_users << non_member_reader
TopicUser.create!(user: non_member_reader, topic: @group_message, last_read_post_number: 4)
get '/post_readers.json', params: { id: @post.id }
readers = JSON.parse(response.body)['post_readers']
expect(readers).to be_empty
end
end
def assert_reader_is_correctly_serialized(reader_data, reader, post)