[Rt-commit] rt branch, 4.4-trunk, created. rt-4.4.0-115-gbf2e9c2
Rachel Kelly
rachel at bestpractical.com
Wed May 11 17:32:22 EDT 2016
The branch, 4.4-trunk has been created
at bf2e9c23af57538a9fe02f8d7176779d6b303bd7 (commit)
- Log -----------------------------------------------------------------
commit b0f432d6b418efda3a4c849ac9a316f3a7311364
Author: rachelkelly <rachel at bestpractical.com>
Date: Thu May 5 07:05:25 2016 +0000
Fix failing FastCGI tests by changing how timestamps are removed from quote header
t/web/signatures.t, introduced in
9df4d3387e22754f160a5aba91f2e25381309b45, overrode the
RT::Transaction::QuoteHeader method to replace the quote header text "On
$date at $time, $person wrote:" with "Someone wrote:" to simplify the
test cases. This solution works in most development environments but
fails in a client/server environment like FastCGI. By the time this
method override happens, the server and client processes have already
forked, so it's simply too late for the test file to redefine methods in
the server. This led to the test failures because the server output the
stock "On $date at $time, $person wrote:" instead of the
simplified-for-tests "Someone wrote:" header.
This commit fixes the test by removing the method override and instead
replacing the "On $date at $time, $person wrote:" with a regex
substitution on the output. In this way is not only agnostic to the test
environment, it is also more insulated from future changes (such as
RT::Transaction method QuoteHeader being refactored away).
diff --git a/t/web/signatures.t b/t/web/signatures.t
index becc1f9..919e1e6 100644
--- a/t/web/signatures.t
+++ b/t/web/signatures.t
@@ -4,12 +4,6 @@ use warnings;
use RT::Test tests => undef;
use HTML::Entities qw/decode_entities/;
-# Remove the timestamp from the quote header
-{
- no warnings 'redefine';
- *RT::Transaction::QuoteHeader = sub { "Someone wrote:" };
-}
-
my ($baseurl, $m) = RT::Test->started_ok;
ok( $m->login, 'logged in' );
@@ -57,6 +51,9 @@ sub template_is {
$display =~ s/^$/./mg;
$display =~ s/([ ]+)$/$1\$/mg;
+ # Remove the timestamp from the quote header
+ $display =~ s/On \w\w\w \w\w\w+ \d\d \d\d:\d\d:\d\d \d\d\d\d, \w+ wrote:/Someone wrote:/;
+
is($display, $expected, "Content matches expected");
my $trim = RT::Interface::Web::StripContent(
commit e7f416cbde094538744b51ba564c8872b07ecb5c
Merge: 391c861 b0f432d
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Wed May 11 19:43:52 2016 +0000
Merge branch '4.4/signature-spacing-test-fix' into 4.4-trunk
commit bf2e9c23af57538a9fe02f8d7176779d6b303bd7
Merge: e7f416c ff38432
Author: rachelkelly <rachel at bestpractical.com>
Date: Thu May 5 06:35:42 2016 +0000
Merge branch '4.4/links-table-layout' into 4.4-trunk
-----------------------------------------------------------------------
More information about the rt-commit
mailing list