Skip to content

Commit

Permalink
Add a submit URL skeleton with tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leto committed Nov 10, 2011
1 parent 6ff3865 commit 530817c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/App/Parrot/Create.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ get '/' => sub {
template 'index';
};

post '/submit' => sub {
template 'submit';
};

true;
5 changes: 4 additions & 1 deletion t/002_index_route.t
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Test::More tests => 2;
use Test::More tests => 4;
use strict;
use warnings;

Expand All @@ -8,3 +8,6 @@ use Dancer::Test;

route_exists [GET => '/'], 'a route handler is defined for /';
response_status_is ['GET' => '/'], 200, 'response status is 200 for /';

route_exists [POST => '/submit'], 'a route handler is defined for /submit';
response_status_is ['POST' => '/submit'], 200, 'response status is 200 for /submit';
1 change: 1 addition & 0 deletions views/submit.tt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Submit template

0 comments on commit 530817c

Please sign in to comment.