8 my $base = 'http://localhost';
14 use Test::WWW::Mechanize::Catalyst 'RestTest';
15 use HTTP::Request::Common;
18 my $mech = Test::WWW::Mechanize::Catalyst->new;
19 ok(my $schema = DBICTest->init_schema(), 'got schema');
21 my $track_list_url = "$base/api/rpc/track_setup_dbic_args/list";
22 my $base_rs = $schema->resultset('Track')->search({}, { select => [qw/me.title me.position/], order_by => 'position' });
26 my $req = GET( $track_list_url, {
28 }, 'Accept' => 'text/x-json' );
30 cmp_ok( $mech->status, '==', 200, 'open attempt okay' );
32 my @expected_response = map { { $_->get_columns } } $base_rs->search({ position => { '!=' => '1' } })->all;
33 my $response = JSON::Any->Load( $mech->content);
34 is_deeply( { list => \@expected_response, success => 'true' }, $response, 'correct message returned' );