add the registry test
This commit is contained in:
parent
b0384f3ad7
commit
d2508a2fec
23
t/registry.t
Normal file
23
t/registry.t
Normal 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();
|
Loading…
Reference in New Issue
Block a user