dmail filters: fix filters being case sensitive.

This commit is contained in:
evazion
2018-09-20 19:51:13 -05:00
parent 03abbd0683
commit 237ab9b782
2 changed files with 20 additions and 1 deletions

View File

@@ -28,6 +28,11 @@ class DmailFilterTest < ActiveSupport::TestCase
create_dmail("okay", "banned")
assert_equal(true, @receiver.dmails.last.is_read?)
end
should "be case insensitive" do
create_dmail("Banned.", "okay")
assert_equal(true, @receiver.dmails.last.is_read?)
end
end
context "a dmail filter for a user name" do
@@ -40,4 +45,13 @@ class DmailFilterTest < ActiveSupport::TestCase
assert_equal(true, @receiver.dmails.last.is_read?)
end
end
context "a dmail filter containing multiple words" do
should "filter dmails containing any of the words" do
@receiver.create_dmail_filter(words: "foo bar spam")
create_dmail("this is a test (not *SPAM*)", "hello world")
assert_equal(true, @receiver.dmails.last.is_read?)
end
end
end