Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: b12260e9f3
Fetching contributors…

Cannot retrieve contributors at this time

49 lines (37 sloc) 1.07 kB
package Test::Lystyng::Schema::Result::List::Util;
use base qw(Test::Class);
use Test::More;
use Moose;
with 'Test::Role::WithSchema';
sub basic : Tests {
my $self = shift;
my $user_rs = $self->schema->resultset('User');
my $list_rs = $self->schema->resultset('List');
my $item_rs = $self->schema->resultset('ListItem');
my $user = $user_rs->create({
username => 'user',
password => 'pass',
email => '',
title => 'test list',
slug => 'test',
my $list = $user->lists->first;
my $item = $list->add_to_list_items({
title => 'test item',
ok($item, 'Got an item_rs');
isa_ok($item, 'Lystyng::Schema::Result::ListItem');
is(scalar $list->list_items, 1, 'List has one item');
my ($item2) = $item_rs->search({
list => $list->id,
title => 'test item',
ok($item2, 'Got a list item from the database...');
is($item2->title, 'test item', '... and it has the correct title');
Jump to Line
Something went wrong with that request. Please try again.