FIX: ignore_by_title should match case-insensitive

This commit is contained in:
Gerhard Schlager
2017-11-12 01:43:18 +01:00
parent 4af7881cb7
commit 4dc4bc70c8
4 changed files with 6 additions and 4 deletions

View File

@ -568,11 +568,10 @@ describe Email::Receiver do
expect { process(:tl4_user) }.to change(Topic, :count)
end
it "ignores by title" do
it "ignores by case-insensitive title" do
SiteSetting.ignore_by_title = "foo"
expect { process(:ignored) }.to_not change(Topic, :count)
end
end
context "new topic in a category that allows strangers" do

View File

@ -21,11 +21,13 @@ describe EmailValidator do
it "adds an error when email matches a blocked email" do
ScreenedEmail.create!(email: 'sam@sam.com', action_type: ScreenedEmail.actions[:block])
expect(blocks?('sam@sam.com')).to eq(true)
expect(blocks?('SAM@sam.com')).to eq(true)
end
it "blocks based on email_domains_blacklist" do
SiteSetting.email_domains_blacklist = "email.com|mail.com|e-mail.com"
expect(blocks?('sam@email.com')).to eq(true)
expect(blocks?('sam@EMAIL.com')).to eq(true)
expect(blocks?('sam@bob.email.com')).to eq(true)
expect(blocks?('sam@e-mail.com')).to eq(true)
expect(blocks?('sam@googlemail.com')).to eq(false)
@ -34,6 +36,7 @@ describe EmailValidator do
it "blocks based on email_domains_whitelist" do
SiteSetting.email_domains_whitelist = "googlemail.com|email.com"
expect(blocks?('sam@email.com')).to eq(false)
expect(blocks?('sam@EMAIL.com')).to eq(false)
expect(blocks?('sam@bob.email.com')).to eq(false)
expect(blocks?('sam@e-mail.com')).to eq(true)
expect(blocks?('sam@googlemail.com')).to eq(false)