FIX: TL0 users' messages to moderators were not being posted when flagging private messages

This commit is contained in:
Neil Lalonde
2017-10-13 11:55:49 -04:00
parent 6f923d5964
commit b124e5f19f
4 changed files with 96 additions and 50 deletions

View File

@ -3,11 +3,12 @@ require 'rails_helper'
describe TopicCreator do
let(:user) { Fabricate(:user, trust_level: TrustLevel[2]) }
let(:user2) { Fabricate(:user, trust_level: TrustLevel[2]) }
let(:moderator) { Fabricate(:moderator) }
let(:admin) { Fabricate(:admin) }
let(:valid_attrs) { Fabricate.attributes_for(:topic) }
let(:pm_valid_attrs) { { raw: 'this is a new post', title: 'this is a new title', archetype: Archetype.private_message, target_usernames: moderator.username } }
let(:pm_valid_attrs) { { raw: 'this is a new post', title: 'this is a new title', archetype: Archetype.private_message, target_usernames: user2.username } }
let(:pm_to_email_valid_attrs) do
{