hydra/t/Controller/projects.t
Cole Helbling 50fab154a4
ToJSON: serialize string_columns to JSON
If the column is undefined, then it should be an empty string according to your
API spec.
2021-04-26 16:39:13 -07:00

39 lines
796 B
Perl

use feature 'unicode_strings';
use strict;
use Setup;
use JSON qw(decode_json);
my %ctx = test_init();
require Hydra::Schema;
require Hydra::Model::DB;
require Hydra::Helper::Nix;
use HTTP::Request::Common;
use Test2::V0;
require Catalyst::Test;
Catalyst::Test->import('Hydra');
my $db = Hydra::Model::DB->new;
hydra_setup($db);
my $project = $db->resultset('Projects')->create({name => "tests", displayname => "", owner => "root"});
my $projectinfo = request(GET '/project/tests',
Accept => 'application/json',
);
ok($projectinfo->is_success);
is(decode_json($projectinfo->content), {
description => "",
displayname => "",
enabled => JSON::true,
hidden => JSON::false,
homepage => "",
jobsets => [],
name => "tests",
owner => "root"
});
done_testing;