Skip to content
Browse files

Update tests

  • Loading branch information...
1 parent 23a0fd9 commit 8e3bc5d82565d478ee9dd20e10e4824fd10b496c @lestrrat committed
Showing with 92 additions and 1 deletion.
  1. +1 −0 Makefile.PL
  2. +1 −1 modules/core
  3. +4 −0 t/000_load.t
  4. +13 −0 t/001_deploy.t
  5. +41 −0 t/002_access.log
  6. +32 −0 t/002_access.t
View
1 Makefile.PL
@@ -27,6 +27,7 @@ if (-f 'Makefile') {
seek $fh, 0, 0;
$content =~ s/pure_all :: config pm_to_blib subdirs linkext/pure_all :: config pm_to_blib subdirs linkext gitmodules/;
+ $content =~ s/"-e" "(test_harness\(\$\(TEST_VERBOSE\), )/"-I\$(INST_LIB)" "-I\$(INST_ARCHLIB)" "-Mlocal::lib=extlib" "-Imodules\/core\/lib" "-MLyra::Test=start_daemons" "-e" "my \\\$\$guard = start_daemons; $1't\/lib', /;
print $fh $content;
close $fh;
2 modules/core
@@ -1 +1 @@
-Subproject commit 86219e2f83450c241d005bede6b3859223348b1b
+Subproject commit 64d0913094a43fed5ef4e68c21bf932e02472d60
View
4 t/000_load.t
@@ -0,0 +1,4 @@
+use strict;
+use Test::More (tests => 1);
+
+use_ok "Lyra::Server::Click";
View
13 t/001_deploy.t
@@ -0,0 +1,13 @@
+use strict;
+use Test::More tests => 3;
+
+use_ok "App::Lyra::DeployAds";
+use_ok "App::Lyra::DeployDB";
+
+eval {
+ # Deploy to master DB
+ App::Lyra::DeployDB->new(
+ data_source => 'Lyra::Test::Fixture::TestDB',
+ )->run();
+};
+ok(! $@, "Done deploy") or diag($@);
View
41 t/002_access.log
@@ -0,0 +1,41 @@
+Twiggy: Accepting connections at http://127.0.0.1:10002/
+failed to connect to 127.0.0.1:11211 at /Users/daisuke/perl5/lib/perl5/Cache/Memcached/AnyEvent.pm line 111, <> line 6.
+Failed to connect to any memcached servers at /Users/daisuke/perl5/lib/perl5/Cache/Memcached/AnyEvent.pm line 169, <> line 6.
+Twiggy: Accepting connections at http://127.0.0.1:10002/
+failed to connect to 127.0.0.1:11211 at /Users/daisuke/perl5/lib/perl5/Cache/Memcached/AnyEvent.pm line 111, <> line 6.
+Failed to connect to any memcached servers at /Users/daisuke/perl5/lib/perl5/Cache/Memcached/AnyEvent.pm line 169, <> line 6.
+Twiggy: Accepting connections at http://127.0.0.1:10002/
+127.0.0.1 - - [07/ 4/2010 12:04:52] "GET /?ad=test_ads_by_area001 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:04:52] "GET /?ad=test_ads_by_area002 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:04:52] "GET /?ad=test_ads_by_area003 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:04:52] "GET /?ad=test_ads_by_area004 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:04:52] "GET /?ad=test_ads_by_area005 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:04:52] "GET /?ad=test_ads_by_area006 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+Twiggy: Accepting connections at http://127.0.0.1:10002/
+127.0.0.1 - - [07/ 4/2010 12:05:52] "GET /?ad=test_ads_by_area001 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:05:52] "GET /?ad=test_ads_by_area002 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:05:52] "GET /?ad=test_ads_by_area003 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:05:52] "GET /?ad=test_ads_by_area004 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:05:52] "GET /?ad=test_ads_by_area005 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:05:52] "GET /?ad=test_ads_by_area006 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+Twiggy: Accepting connections at http://127.0.0.1:10002/
+127.0.0.1 - - [07/ 4/2010 12:08:01] "GET /?ad=test_ads_by_area001 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:08:01] "GET /?ad=test_ads_by_area002 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:08:01] "GET /?ad=test_ads_by_area003 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:08:01] "GET /?ad=test_ads_by_area004 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:08:01] "GET /?ad=test_ads_by_area005 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:08:01] "GET /?ad=test_ads_by_area006 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+Twiggy: Accepting connections at http://127.0.0.1:10002/
+127.0.0.1 - - [07/ 4/2010 12:08:25] "GET /?ad=test_ads_by_area001 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:08:25] "GET /?ad=test_ads_by_area002 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:08:25] "GET /?ad=test_ads_by_area003 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:08:25] "GET /?ad=test_ads_by_area004 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:08:25] "GET /?ad=test_ads_by_area005 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:08:25] "GET /?ad=test_ads_by_area006 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+Twiggy: Accepting connections at http://127.0.0.1:10002/
+127.0.0.1 - - [07/ 4/2010 12:08:48] "GET /?ad=test_ads_by_area001 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:08:48] "GET /?ad=test_ads_by_area002 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:08:48] "GET /?ad=test_ads_by_area003 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:08:48] "GET /?ad=test_ads_by_area004 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:08:48] "GET /?ad=test_ads_by_area005 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
+127.0.0.1 - - [07/ 4/2010 12:08:48] "GET /?ad=test_ads_by_area006 HTTP/1.1" 302 - "-" "libwww-perl/5.834"
View
32 t/002_access.t
@@ -0,0 +1,32 @@
+use strict;
+use Test::More;
+use LWP::UserAgent;
+use URI;
+use Lyra::Extlib;
+use Lyra::Test qw(dbic_schema click_server);
+
+my $click_server = click_server
+ name => "002_access"
+;
+
+my $schema = dbic_schema();
+my $rs = $schema->resultset('AdsMaster');
+
+my $ua = LWP::UserAgent->new(
+ max_redirect => 0, # don't redirect us for this test
+);
+my $base = URI->new("http://127.0.0.1:" . $click_server->port);
+while (my $row = $rs->next) {
+ $base->query_form( ad => $row->id );
+ my $res = $ua->get( $base );
+
+ if (! (
+ is( $res->code, '302', "status is 302" ) &&
+ is( $res->header('Location'), $row->landing_uri, "redirect uri is correct" )
+ ) ) {
+ diag( "Unexpected response" );
+ diag( $res->as_string );
+ }
+}
+
+done_testing();

0 comments on commit 8e3bc5d

Please sign in to comment.
Something went wrong with that request. Please try again.