sergiotarxz
156e69c825
Since the project is not functional still I made the changes needed in database in order of it to work directly over the creation migration.
44 lines
1.0 KiB
Perl
44 lines
1.0 KiB
Perl
#!/usr/bin/env perl
|
|
|
|
use v5.30.0;
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
use Test::Most tests => 2;
|
|
|
|
use DateTime;
|
|
|
|
use Peace;
|
|
use Peace::DB;
|
|
use Peace::Model::Developer;
|
|
use Peace::DAO::Developer;
|
|
|
|
{
|
|
## GIVEN
|
|
my $current_date = DateTime->now;
|
|
my $peace = Peace->new;
|
|
my $home = $ENV{HOME};
|
|
my $config =
|
|
$peace->plugin(
|
|
JSONConfig => { file => "$home/.config/peace/peace.conf" } );
|
|
my $dbh = Peace::DB->dbh( config => $config );
|
|
my $secret_bcrypt = 'hola';
|
|
my $developer = Peace::Model::Developer->new(
|
|
name => 'Larry',
|
|
surname => 'Wall',
|
|
email => 'larry@perl.org',
|
|
country => 'US',
|
|
verified => 0,
|
|
secret_bcrypt => $secret_bcrypt
|
|
);
|
|
my $developer_dao = Peace::DAO::Developer->new( dbh => $dbh );
|
|
|
|
## WHEN
|
|
$developer_dao->create( developer => $developer );
|
|
|
|
## THEN
|
|
ok $developer->uuid, 'Generated uuid.';
|
|
ok $developer->date_creation > $current_date, 'The date is recent.';
|
|
}
|