nfig_dir } );
my @all_configs = map { basename $_}
File::Find::Rule->file->name(qr/\.json$/)->in($config_dir);
for my $config_file (@all_configs) {
my $fixture_dir = catdir(
}
);
post '/cvterms' => [ format => [qw/json/] ] => sub {
my $self = shift;
my $params = $self->req->json;
for my $p (qw/namespace id name/) {
}
);
$self->res->headers->location( "/cvterms/" . $params->{id} . ".json" );
$self->rendered(201);
};
$app->start;
During the unit testing, the B<schema
Test::Mojo->new;
$t->app->schema($schema);
my $post = $t->post_ok(
'/cvterms.json' => json => {
namespace => 'test-chado-mojoapp',
id => 'TC:000001',
se JSON;
use feature qw/say/;
extends qw/Test::Chado::DBManager::Pg/;
sub _build_dbh {
my ($self) = @_;
my $ua = HTTP::Tiny->new(
default_headers => { 'Accept' => 'application/json' }
e "status: $response->{status}\treason: $response->{reason}\n";
}
my $resp_hash = decode_json $response->{content};
my $dsn
= "dbi:Pg:dbname=$resp_hash->{dbname};host=$resp_hash->