Skip to content

Commit

Permalink
Fixed indentation issues and added some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward committed Jan 9, 2011
1 parent 218289b commit 5591c62
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
4 changes: 2 additions & 2 deletions App-Catable/lib/App/Catable/Controller/Root.pm
Expand Up @@ -27,8 +27,8 @@ App::Catable::Controller::Root - Root Controller for App::Catable
=cut

sub index : Path : Args(0) {
my ( $self, $c ) = @_;
$c->stash->{template} = 'index.tt2';
my ( $self, $c ) = @_;
$c->stash->{template} = 'index.tt2';
}

sub default : Private {
Expand Down
2 changes: 2 additions & 0 deletions App-Catable/root/src/posts/no-posts-found.tt2
@@ -0,0 +1,2 @@
<h1>No Posts Found</h1>
<p>Couldn't find any posts at this time - please come back later or alter your search terms.</p>
4 changes: 4 additions & 0 deletions App-Catable/root/src/posts/no_tag_found.tt2
@@ -0,0 +1,4 @@
[% title = 'Tag Could Not Be Found' %]
<h1>Tag Could Not Be Found</h1>

<p>The tag <strong>[% tags_query | html %]</strong> couldn't be found in our database. Please go back and try another.</p>
10 changes: 10 additions & 0 deletions App-Catable/t/controller_Posts_tags_mech.t
@@ -0,0 +1,10 @@
#!/usr/bin/perl
use strict;
use warnings;
use Test::More qw(no_plan);

use Test::WWW::Mechanize::Catalyst;
my $mech = Test::WWW::Mechanize::Catalyst->new(catalyst_app => 'App::Catable');
$mech->get_ok('/posts/tag/not-a-real-tag-at-all');
$mech->content_contains('not-a-real-tag-at-all');
#TODO: Test for a real tag
15 changes: 15 additions & 0 deletions App-Catable/t/lib/for-notify/App/Catable/Controller/Notify.pm
@@ -0,0 +1,15 @@
package App::Catable::Controller::Notify;

use strict;
use warnings;
use base 'Catalyst::Controller';

# Provided so tests can use notify without relying on any other mechanism
sub hello_world : Local {
my ($self, $c) = @_;
$c->add_notification("Hello, world!");
$c->stash->{'template'} = 'index.tt2';
return;
}

1;

0 comments on commit 5591c62

Please sign in to comment.