Reworked api login to just need a session_key for everything
This commit is contained in:
parent
1d02854c96
commit
68b66d431c
9 changed files with 271 additions and 214 deletions
41
lib/Test/Pear/LocalLoop.pm
Normal file
41
lib/Test/Pear/LocalLoop.pm
Normal file
|
@ -0,0 +1,41 @@
|
|||
package Test::Pear::LocalLoop;
|
||||
use Mojo::Base -base;
|
||||
|
||||
use File::Temp;
|
||||
use Test::Mojo;
|
||||
|
||||
has config => sub {
|
||||
my $file = File::Temp->new;
|
||||
|
||||
print $file <<'END';
|
||||
{
|
||||
dsn => "dbi:SQLite::memory:",
|
||||
user => undef,
|
||||
pass => undef,
|
||||
}
|
||||
END
|
||||
|
||||
$file->seek( 0, SEEK_END );
|
||||
return $file;
|
||||
};
|
||||
|
||||
has framework => sub {
|
||||
my $self = shift;
|
||||
|
||||
$ENV{MOJO_CONFIG} = $self->config->filename;
|
||||
|
||||
my $t = Test::Mojo->new('Pear::LocalLoop');
|
||||
my $schema = $t->app->schema;
|
||||
$schema->deploy;
|
||||
|
||||
$schema->resultset('AgeRange')->populate([
|
||||
[ qw/ agerangestring / ],
|
||||
[ '20-35' ],
|
||||
[ '35-50' ],
|
||||
[ '50+' ],
|
||||
]);
|
||||
|
||||
return $t;
|
||||
};
|
||||
|
||||
1;
|
Reference in a new issue