mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
FIX: better error message when user without permissions replies via email
This commit is contained in:

committed by
Guo Xiang Tan

parent
70b73c2159
commit
87d3b86484
@ -298,6 +298,13 @@ describe Email::Receiver do
|
||||
expect(post.user).to eq(user)
|
||||
end
|
||||
|
||||
it "raises a ReplyNotAllowedError when user without permissions is replying" do
|
||||
Fabricate(:user, email: "bob@bar.com")
|
||||
category.set_permissions(admins: :full)
|
||||
category.save
|
||||
expect { process(:reply_user_not_matching_but_known) }.to raise_error(Email::Receiver::ReplyNotAllowedError)
|
||||
end
|
||||
|
||||
it "raises a TopicNotFoundError when the topic was deleted" do
|
||||
topic.update_columns(deleted_at: 1.day.ago)
|
||||
expect { process(:reply_user_matching) }.to raise_error(Email::Receiver::TopicNotFoundError)
|
||||
|
Reference in New Issue
Block a user