[Bast-commits] r9899 - in
ironman/IronMan-Web/branches/idn-20110706: . lib/IronMan
lib/IronMan/Web/Controller lib/IronMan/Web/View root root/email t
idn at dev.catalyst.perl.org
idn at dev.catalyst.perl.org
Wed Jul 6 15:56:37 GMT 2011
Author: idn
Date: 2011-07-06 15:56:37 +0000 (Wed, 06 Jul 2011)
New Revision: 9899
Added:
ironman/IronMan-Web/branches/idn-20110706/ironman_web_testing.conf
ironman/IronMan-Web/branches/idn-20110706/lib/IronMan/Web/View/TTNoWrapper.pm
ironman/IronMan-Web/branches/idn-20110706/root/email/
ironman/IronMan-Web/branches/idn-20110706/root/email/retrieve_key.tt
ironman/IronMan-Web/branches/idn-20110706/t/controller_root.t
ironman/IronMan-Web/branches/idn-20110706/t/view_TTNoWrapper.t
Modified:
ironman/IronMan-Web/branches/idn-20110706/lib/IronMan/Web.pm
ironman/IronMan-Web/branches/idn-20110706/lib/IronMan/Web/Controller/Root.pm
ironman/IronMan-Web/branches/idn-20110706/t/01app.t
Log:
Committing code to update site in general but also to add testing for email feed update stuff
Added: ironman/IronMan-Web/branches/idn-20110706/ironman_web_testing.conf
===================================================================
--- ironman/IronMan-Web/branches/idn-20110706/ironman_web_testing.conf (rev 0)
+++ ironman/IronMan-Web/branches/idn-20110706/ironman_web_testing.conf 2011-07-06 15:56:37 UTC (rev 9899)
@@ -0,0 +1,18 @@
+<recaptcha>
+## localhost keys
+ priv_key 6LcsbAAAAAAAANQQGqwsnkrTd7QTGRBKQQZwBH-L
+ pub_key 6LcsbAAAAAAAAPDSlBaVGXjMo1kJHwUiHzO2TDze
+</recaptcha>
+
+<Model::FeedDB>
+ <connect_info>
+ dsn dbi:SQLite:t/var/test.db
+ </connect_info>
+</Model::FeedDB>
+
+<View::Email>
+ <sender>
+ mailer Print
+ </sender>
+</View::Email>
+
Modified: ironman/IronMan-Web/branches/idn-20110706/lib/IronMan/Web/Controller/Root.pm
===================================================================
--- ironman/IronMan-Web/branches/idn-20110706/lib/IronMan/Web/Controller/Root.pm 2011-07-06 15:51:24 UTC (rev 9898)
+++ ironman/IronMan-Web/branches/idn-20110706/lib/IronMan/Web/Controller/Root.pm 2011-07-06 15:56:37 UTC (rev 9899)
@@ -188,15 +188,10 @@
$c->log->info( 'found key: ' . $feed->id );
$c->stash(
email => {
- to => $email,
- from => 'me at dhoss.net',
- subject => 'Your IronMan Blog Key',
- body => qq{ Hello } . $feed->owner . qq{,
- You or someone else has requested your IronMan Blog key.
- Here it is: } . $feed->id . qq{
- Regards,
- The IronMan Blogging Tech Monkies
- },
+ to => $email,
+ from => 'me at dhoss.net',
+ subject => 'Your IronMan Blog Key',
+ body => $c->view('TTNoWrapper')->render( $c, "email/retrieve_key.tt" ),
},
);
Added: ironman/IronMan-Web/branches/idn-20110706/lib/IronMan/Web/View/TTNoWrapper.pm
===================================================================
--- ironman/IronMan-Web/branches/idn-20110706/lib/IronMan/Web/View/TTNoWrapper.pm (rev 0)
+++ ironman/IronMan-Web/branches/idn-20110706/lib/IronMan/Web/View/TTNoWrapper.pm 2011-07-06 15:56:37 UTC (rev 9899)
@@ -0,0 +1,36 @@
+package IronMan::Web::View::TTNoWrapper;
+
+use strict;
+use warnings;
+
+use base 'Catalyst::View::TT';
+
+__PACKAGE__->config(
+ TEMPLATE_EXTENSION => '.tt',
+ render_die => 1,
+);
+
+=head1 NAME
+
+IronMan::Web::View::TTNoWrapper - TT View for IronMan::Web
+
+=head1 DESCRIPTION
+
+TT View for IronMan::Web.
+
+=head1 SEE ALSO
+
+L<IronMan::Web>
+
+=head1 AUTHOR
+
+Ian Norton,,,
+
+=head1 LICENSE
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
+1;
Modified: ironman/IronMan-Web/branches/idn-20110706/lib/IronMan/Web.pm
===================================================================
--- ironman/IronMan-Web/branches/idn-20110706/lib/IronMan/Web.pm 2011-07-06 15:51:24 UTC (rev 9898)
+++ ironman/IronMan-Web/branches/idn-20110706/lib/IronMan/Web.pm 2011-07-06 15:56:37 UTC (rev 9899)
@@ -4,7 +4,7 @@
use warnings;
use Catalyst::Runtime '5.70';
-use lib '/usr/src/perl/dbix-class/bast/ironman/plagger/lib';
+#use lib '/usr/src/perl/dbix-class/bast/ironman/plagger/lib';
# Set flags and add plugins for the application
#
Added: ironman/IronMan-Web/branches/idn-20110706/root/email/retrieve_key.tt
===================================================================
--- ironman/IronMan-Web/branches/idn-20110706/root/email/retrieve_key.tt (rev 0)
+++ ironman/IronMan-Web/branches/idn-20110706/root/email/retrieve_key.tt 2011-07-06 15:56:37 UTC (rev 9899)
@@ -0,0 +1,8 @@
+Hello [% feed.owner %],
+
+You or someone else has requested your IronMan Blog key.
+
+Here it is: [% feed.id %]
+
+Regards,
+The IronMan Team
Modified: ironman/IronMan-Web/branches/idn-20110706/t/01app.t
===================================================================
--- ironman/IronMan-Web/branches/idn-20110706/t/01app.t 2011-07-06 15:51:24 UTC (rev 9898)
+++ ironman/IronMan-Web/branches/idn-20110706/t/01app.t 2011-07-06 15:56:37 UTC (rev 9899)
@@ -2,6 +2,10 @@
use warnings;
use Test::More tests => 2;
-BEGIN { use_ok 'Catalyst::Test', 'IronMan::Web' }
+unless(defined($ENV{'CATALYST_CONFIG_LOCAL_SUFFIX'})) {
+ die "CATALYST_CONFIG_LOCAL_SUFFIX environment variable *MUST* be set";
+}
+use_ok('Catalyst::Test', 'IronMan::Web');
+
ok( request('/')->is_success, 'Request should succeed' );
Added: ironman/IronMan-Web/branches/idn-20110706/t/controller_root.t
===================================================================
--- ironman/IronMan-Web/branches/idn-20110706/t/controller_root.t (rev 0)
+++ ironman/IronMan-Web/branches/idn-20110706/t/controller_root.t 2011-07-06 15:56:37 UTC (rev 9899)
@@ -0,0 +1,76 @@
+use strict;
+use warnings;
+
+use Test::More qw(no_plan);
+
+use ok "Test::WWW::Mechanize::Catalyst" => "IronMan::Web";
+
+my $content;
+my $uri;
+
+my $email = 'i.d.norton at gmail.com';
+
+
+# Create a 'user agent' request
+my $req = Test::WWW::Mechanize::Catalyst->new();
+my $base_uri = "http://localhost/";
+
+#################################
+###### Register some feeds ######
+#################################
+
+# Fetch the form to send token reminder
+$uri = $base_uri . "new_feed";
+$req->get_ok($uri, "fetching $uri");
+ok($req->status() == 200, "status 200 for '$uri'");
+
+# Check the page title
+$content = "Planet Perl Iron Man";
+$req->title_is( $content, "expected title - '$content'");
+
+# Check the contents
+$content = "Blog feed URL (atom preferred)";
+$req->content_contains($content, "expected content - '$content'");
+
+# Submit the form
+$req->submit_form( 'fields' => {
+ 'url' => "http://127.0.0.1",
+ 'title' => "localhost test",
+ 'email' => 'person at example.com',
+ 'email_2' => 'person at example.com',
+});
+ok($req->status() == 200, "status 200 for '$uri' form submission");
+
+# Check the contents - this should be a failure message
+$content = "Cannot fetch feed";
+$req->content_contains($content, "expected content - '$content'");
+
+
+
+
+
+#diag( $req->content );
+
+exit;
+
+
+
+
+# Fetch the form to send token reminder
+$uri = $base_uri . "retrieve_key";
+$req->get_ok($uri, "fetching $uri");
+ok($req->status() == 200, "status 200 for $uri");
+
+# Check the page title
+$content = "Planet Perl Iron Man";
+$req->title_is( $content, "expected title - $content");
+
+# Check the contents
+$content = "Retrieve your IronMan Blog key";
+$req->content_contains($content, "expected content - $content");
+
+# Submit the form
+$req->submit_form( 'fields' => { 'email' => $email } );
+ok($req->status() == 200, "status 200 for $uri form submission");
+
+
Added: ironman/IronMan-Web/branches/idn-20110706/t/view_TTNoWrapper.t
===================================================================
--- ironman/IronMan-Web/branches/idn-20110706/t/view_TTNoWrapper.t (rev 0)
+++ ironman/IronMan-Web/branches/idn-20110706/t/view_TTNoWrapper.t 2011-07-06 15:56:37 UTC (rev 9899)
@@ -0,0 +1,7 @@
+use strict;
+use warnings;
+use Test::More;
+
+BEGIN { use_ok 'IronMan::Web::View::TTNoWrapper' }
+
+done_testing();
More information about the Bast-commits
mailing list