-
-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #253 from oreoshake/regression-email-reply-pipeline
Regression in EmailReplyPipeline: unfiltered content is being ommitted
- Loading branch information
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,38 @@ def test_hides_email_addresses_when_configured | |
refute_match %r([email protected]), doc | ||
refute_match %r([email protected]), doc | ||
end | ||
|
||
def test_preserves_non_email_content_while_filtering | ||
str = <<-EMAIL | ||
> Thank you! I have some thoughts on this pull request. | ||
> | ||
> * acme provides cmake and a wrapper for it. Please use '$(TARGET)-cmake' instead of cmake -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' -DCMAKE_BUILD_TYPE=Release. | ||
Okay -- I'm afraid I just blindly copied the eigen3.mk file, since that's a library I'm familiar with :-) | ||
> * Do you need -DCMAKE_SYSTEM_PROCESSOR=x86? | ||
Yes, this is a bit dumb, but vc checks for that (or amd) to determine that it's not being built on ARM. | ||
-- | ||
Boaty McBoatface | http://example.org | ||
|
||
filter = EmailReplyFilter.new(str, :hide_quoted_email_addresses => true) | ||
doc = filter.call.to_s | ||
|
||
expected = <<-EXPECTED | ||
<div class="email-quoted-reply"> Thank you! I have some thoughts on this pull request. | ||
* acme provides cmake and a wrapper for it. Please use '$(TARGET)-cmake' instead of cmake -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' -DCMAKE_BUILD_TYPE=Release.</div> | ||
<div class="email-fragment">Okay -- I'm afraid I just blindly copied the eigen3.mk file, since that's a library I'm familiar with :-)</div> | ||
<div class="email-quoted-reply"> * Do you need -DCMAKE_SYSTEM_PROCESSOR=x86?</div> | ||
<div class="email-fragment">Yes, this is a bit dumb, but vc checks for that (or amd) to determine that it's not being built on ARM.</div> | ||
<span class="email-hidden-toggle"><a href="#">…</a></span><div class="email-hidden-reply" style="display:none"><div class="email-signature-reply">-- | ||
Boaty McBoatface | http://example.org</div> | ||
</div> | ||
EXPECTED | ||
|
||
assert_equal(expected.chomp, doc) | ||
end | ||
end |