Catalyst-Helper-Controller-DBIC-API-REST

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

            "Catalyst::Controller::DBIC::API::REST" : "2.006002",
            "Catalyst::Helper" : "0",
            "Catalyst::Model::DBIC::Schema" : "0",
            "Catalyst::Utils" : "0",
            "DBIx::Class::Core" : "0",
            "DBIx::Class::ResultSet" : "0",
            "DBIx::Class::Schema" : "0",
            "File::Copy::Recursive" : "0",
            "File::Path" : "0",
            "File::Spec" : "0",
            "HTTP::Request::Common" : "0",
            "IO::Handle" : "0",
            "IPC::Open3" : "0",
            "JSON::XS" : "0",
            "Test::Deep" : "0",
            "Test::More" : "0",
            "Test::WWW::Mechanize::Catalyst" : "0",
            "URI" : "0",
            "base" : "0",
            "blib" : "1.01",
            "bytes" : "0",

META.yml  view on Meta::CPAN

  Catalyst::Controller::DBIC::API::REST: '2.006002'
  Catalyst::Helper: '0'
  Catalyst::Model::DBIC::Schema: '0'
  Catalyst::Utils: '0'
  DBIx::Class::Core: '0'
  DBIx::Class::ResultSet: '0'
  DBIx::Class::Schema: '0'
  File::Copy::Recursive: '0'
  File::Path: '0'
  File::Spec: '0'
  HTTP::Request::Common: '0'
  IO::Handle: '0'
  IPC::Open3: '0'
  JSON::XS: '0'
  Test::Deep: '0'
  Test::More: '0'
  Test::WWW::Mechanize::Catalyst: '0'
  URI: '0'
  base: '0'
  blib: '1.01'
  bytes: '0'

Makefile.PL  view on Meta::CPAN

    "Catalyst::Controller::DBIC::API::REST" => "2.006002",
    "Catalyst::Helper" => 0,
    "Catalyst::Model::DBIC::Schema" => 0,
    "Catalyst::Utils" => 0,
    "DBIx::Class::Core" => 0,
    "DBIx::Class::ResultSet" => 0,
    "DBIx::Class::Schema" => 0,
    "File::Copy::Recursive" => 0,
    "File::Path" => 0,
    "File::Spec" => 0,
    "HTTP::Request::Common" => 0,
    "IO::Handle" => 0,
    "IPC::Open3" => 0,
    "JSON::XS" => 0,
    "Test::Deep" => 0,
    "Test::More" => 0,
    "Test::WWW::Mechanize::Catalyst" => 0,
    "URI" => 0,
    "base" => 0,
    "blib" => "1.01",
    "bytes" => 0,

Makefile.PL  view on Meta::CPAN

  "Catalyst::Model::DBIC::Schema" => 0,
  "Catalyst::Utils" => 0,
  "Class::Load" => 0,
  "DBIx::Class::Core" => 0,
  "DBIx::Class::ResultSet" => 0,
  "DBIx::Class::Schema" => 0,
  "File::Copy::Recursive" => 0,
  "File::Path" => 0,
  "File::Spec" => 0,
  "FindBin" => 0,
  "HTTP::Request::Common" => 0,
  "IO::Handle" => 0,
  "IPC::Open3" => 0,
  "JSON::XS" => 0,
  "List::Util" => 0,
  "Path::Tiny" => 0,
  "Test::Deep" => 0,
  "Test::More" => 0,
  "Test::WWW::Mechanize::Catalyst" => 0,
  "URI" => 0,
  "base" => 0,

t/create2.t  view on Meta::CPAN

use strict;
use warnings;

use lib 't/lib';

my $host = 'http://localhost';

require DBICTest;
use Test::More tests => 7;
use Test::WWW::Mechanize::Catalyst 'RestTest';
use HTTP::Request::Common;
use JSON::XS;

my $mech = Test::WWW::Mechanize::Catalyst->new;
ok( my $schema = DBICTest->init_schema(), 'got schema' );

my $artist_create_url   = "$host/api/rest/artist";
my $producer_create_url = "$host/api/rest/producer";

# test validation when wrong params sent
{

t/delete.t  view on Meta::CPAN


use lib 't/lib';

my $host = 'http://localhost';
my $content_type = [ 'Content-Type', 'application/x-www-form-urlencoded' ];

use RestTest;
use DBICTest;
use Test::More tests => 4;
use Test::WWW::Mechanize::Catalyst 'RestTest';
use HTTP::Request::Common;
use JSON::XS;

my $mech = Test::WWW::Mechanize::Catalyst->new;
ok( my $schema = DBICTest->init_schema(), 'got schema' );

my $track         = $schema->resultset('Track')->first;
my %original_cols = $track->get_columns;

my $track_delete_url = "$host/api/rest/track/" . $track->id;

{
    my $req = HTTP::Request->new( DELETE => $track_delete_url );
    $req->content_type('text/x-json');
    $mech->request($req);
    cmp_ok( $mech->status, '==', 200, 'Attempt to delete track ok' );

    my $deleted_track = $schema->resultset('Track')->find( $track->id );
    is( $deleted_track, undef, 'track deleted' );
}

{
    my $req = HTTP::Request->new( DELETE => $track_delete_url );
    $req->content_type('text/x-json');
    $mech->request($req);
    cmp_ok( $mech->status, '==', 400, 'Attempt to delete again caught' );
}

t/list.t  view on Meta::CPAN


my $host = 'http://localhost';

use RestTest;
use DBICTest;
use URI;
use Test::More tests => 20;

use Test::Deep;
use Test::WWW::Mechanize::Catalyst 'RestTest';
use HTTP::Request::Common;
use JSON::XS;

my $mech = Test::WWW::Mechanize::Catalyst->new;
ok( my $schema = DBICTest->init_schema(), 'got schema' );

my $artist_list_url   = "$host/api/rest/artist";
my $producer_list_url = "$host/api/rest/producer";

# test open request
{

t/update.t  view on Meta::CPAN

use lib 'lib';
use lib 't/lib';

my $host = 'http://localhost';
my $content_type = [ 'Content-Type', 'application/x-www-form-urlencoded' ];

use RestTest;
use DBICTest;
use Test::More tests => 15;
use Test::WWW::Mechanize::Catalyst 'RestTest';
use HTTP::Request::Common;
use JSON::XS;

my $mech = Test::WWW::Mechanize::Catalyst->new;
ok( my $schema = DBICTest->init_schema(), 'got schema' );

my $track = $schema->resultset('Track')->first;

my %original_cols = $track->get_columns;

my $track_update_url = "$host/api/rest/track/" . $track->id;



( run in 0.390 second using v1.01-cache-2.11-cpan-de7293f3b23 )