CatalystX-ListFramework

 view release on metacpan or  search on metacpan

t/live-test.t  view on Meta::CPAN

# a live test against TestApp, the test application
use Test::WWW::Mechanize::Catalyst 'TestApp';
my $mech = Test::WWW::Mechanize::Catalyst->new;

$mech->get_ok('/start', 'Reset SQLite DB');

$mech->get_ok('/list/track', 'Get /list/track');

$mech->content_like(qr{TEMPLATE\sOK}xsm, 'Template compiles');
$mech->content_like(qr{\b13\sentries}xsm, 'Right number of records');
$mech->content_like(qr{track\scode.+track\stitle.+album\sreleased.+artist\sname}xism, 'Display column headings cascade');
$mech->content_like(qr{02/03/1989}xsm, 'Date format helper works');
$mech->content_like(qr{Mike\sSmith}xsm, 'Compound name fields work');

$mech->get_ok('/list/track?myprefixsort=fromalbum.artist.acombined_name-asc');
$mech->content_like(qr{\b13\sentries}xsm, 'Right number of records after 2nd call (i.e. $c updated in FB cache)');
$mech->content_like(qr{David\sBrown.+Adam\sSmith.+Mike\sSmith}xsm, 'Sorting on surname,firstname works');

$mech->get_ok('/listsearch/track');
$mech->content_like(qr{of\s13}xsm, 'Searchboxes template working');



( run in 0.614 second using v1.01-cache-2.11-cpan-49f99fa48dc )