mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: add email reply error message for topic not getting created in restricted category
This commit is contained in:
@ -562,6 +562,25 @@ greatest show ever created. Everyone should watch it.
|
||||
expect(e.message).to include("too short")
|
||||
end
|
||||
|
||||
|
||||
it "blocks user in restricted group from creating topic" do
|
||||
to = "some@email.com"
|
||||
|
||||
restricted_user = Fabricate(:user, trust_level: 4)
|
||||
restricted_group = Fabricate(:group)
|
||||
restricted_group.add(restricted_user)
|
||||
restricted_group.save
|
||||
|
||||
category = Fabricate(:category, email_in_allow_strangers: false, email_in: to)
|
||||
category.set_permissions(restricted_group => :readonly)
|
||||
category.save
|
||||
|
||||
expect{
|
||||
process_email(from: restricted_user.email, to: to)
|
||||
}.to raise_error(Discourse::InvalidAccess)
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user