mirror of
https://github.com/discourse/discourse.git
synced 2025-09-04 08:47:37 +08:00
FIX: 'reply by email addresses' site settings should allow email addresses without a 'reply_key' when 'find related post with key' is disabled
This commit is contained in:
parent
334ed74346
commit
6a78669ca3
3 changed files with 13 additions and 4 deletions
|
@ -18,6 +18,11 @@ describe ReplyByEmailAddressValidator do
|
|||
expect(validator.valid_value?('foo@bar.com')).to eq(false)
|
||||
end
|
||||
|
||||
it "returns true if value does not contain '%{reply_key}' but 'find_related_post_with_key' is also disabled" do
|
||||
SiteSetting.expects(:find_related_post_with_key).returns(false)
|
||||
expect(validator.valid_value?('foo@bar.com')).to eq(true)
|
||||
end
|
||||
|
||||
it "returns false if value is the same as SiteSetting.notification_email" do
|
||||
SiteSetting.expects(:notification_email).returns("foo@bar.com")
|
||||
expect(validator.valid_value?('foo+%{reply_key}@bar.com')).to eq(false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue