6 my $base = 'http://localhost';
12 use Test::WWW::Mechanize::Catalyst 'RestTest';
13 use HTTP::Request::Common;
16 my $json = JSON->new->utf8;
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";
23 $schema->resultset('Track')
25 { select => [qw/me.title me.position/], order_by => 'position' } );
34 'Accept' => 'text/x-json'
37 cmp_ok( $mech->status, '==', 200, 'open attempt okay' );
39 my @expected_response = map {
41 } $base_rs->search( { position => { '!=' => '1' } } )->all;
42 my $response = $json->decode( $mech->content );
43 is_deeply( { list => \@expected_response, success => 'true' },
44 $response, 'correct message returned' );