FIX: Force enable user PM emails option when user posts to a group by email.

This commit is contained in:
Penar Musaraj
2018-10-01 14:01:24 -04:00
committed by Guo Xiang Tan
parent d9bea66365
commit da9eee5262
3 changed files with 24 additions and 0 deletions

View File

@ -609,6 +609,14 @@ describe Email::Receiver do
expect(Post.last.raw).to match(/discourse\.rb/)
end
it "enables user's email_private_messages option when user emails group" do
user = Fabricate(:user, email: "existing@bar.com")
user.user_option.update_columns(email_private_messages: false)
expect { process(:group_existing_user) }.to change(Topic, :count)
user.reload
expect(user.user_option.email_private_messages).to eq(true)
end
context "with forwarded emails enabled" do
before { SiteSetting.enable_forwarded_emails = true }