Created
October 25, 2014 21:50
-
-
Save andrewsolomon/8c05fa06f6df3d6938d9 to your computer and use it in GitHub Desktop.
Dancer2 0.153 Unit testing example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use Test::More tests => 2; | |
use strict; | |
use warnings; | |
use Plack::Test; | |
use HTTP::Request::Common; | |
use GuArt::Controller; | |
my $app = GuArt::Controller->psgi_app; | |
my $test = Plack::Test->create($app); | |
my $res = $test->request( GET "/"); | |
is $res->code, 302, 'response status is 302 for / without logging in'; | |
$res = $test->request( POST "/",[ | |
login_user => 'Andrew' | |
]); | |
is($res->code, 200, 'successful 200 response on login'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment