add the registry test

This commit is contained in:
Yanick Champoux 2023-10-31 12:16:36 -04:00
parent b0384f3ad7
commit d2508a2fec

23
t/registry.t Normal file
View File

@ -0,0 +1,23 @@
use Test2::V0;
use Dancer2::Plugin::JsonApi::Registry;
use experimental qw/ signatures /;
my $registry = Dancer2::Plugin::JsonApi::Registry->new;
$registry->add_type(
people => {
id => 'id',
links => {
self => sub($data) {
return "/peoples/$data->{id}"
}
}
}
);
isa_ok $registry->type('people') => 'Dancer2::Plugin::JsonApi::Registry::Type';
done_testing();