Testing using the helper in the developer model to retrieve the applications

instead of the dao function in application.
This commit is contained in:
sergiotarxz 2022-03-17 02:44:09 +01:00
parent 138e21137a
commit 04824db8f4
1 changed files with 5 additions and 5 deletions

View File

@ -74,7 +74,8 @@ use Peace::DAO::Application;
email => 'larry@perl.org',
country => 'US',
verified => 0,
secret_bcrypt => $secret_bcrypt
secret_bcrypt => $secret_bcrypt,
dbh => $dbh,
);
my $developer_dao = Peace::DAO::Developer->new( dbh => $dbh );
$developer_dao->create( developer => $developer );
@ -94,11 +95,10 @@ use Peace::DAO::Application;
$application_dao->create( application => $application );
## WHEN
my $applicatios =
$application_dao->recover_by_developer( developer => $developer );
my $applications = $developer->applications;
## THEN
ok @$applicatios, 'Applications was at least a element.';
ok $applicatios->[0]->isa('Peace::Model::Application'),
ok @$applications, 'Applications was at least a element.';
ok $applications->[0]->isa('Peace::Model::Application'),
'Application is made of developer.';
}