TWMC: Add white label (Host header) testing
[catagits/Test-WWW-Mechanize-Catalyst.git] / t / white_label.t
diff --git a/t/white_label.t b/t/white_label.t
new file mode 100644 (file)
index 0000000..11c926d
--- /dev/null
@@ -0,0 +1,16 @@
+use strict;
+use warnings;
+
+use Test::More tests => 4;
+use lib 't/lib';
+use Test::WWW::Mechanize::Catalyst;
+
+my $m = Test::WWW::Mechanize::Catalyst->new(catalyst_app => 'Catty');
+
+$m->host('foo.com');
+$m->get_ok('/host');
+$m->content_contains('Host: foo.com:80');
+
+$m->clear_host;
+$m->get_ok('/host');
+$m->content_contains('Host: localhost:80') or diag $m->content;