10 |
|
|
11 |
use Jifty::Test tests => 11; |
use Jifty::Test tests => 11; |
12 |
|
|
13 |
|
my $nr = 3; |
14 |
|
|
15 |
# Make sure we can load the model |
# Make sure we can load the model |
16 |
use_ok('Transports::Model::Destination'); |
use_ok('Transports::Model::Destination'); |
17 |
|
|
34 |
# Searches in general |
# Searches in general |
35 |
my $collection = Transports::Model::DestinationCollection->new(current_user => $system_user); |
my $collection = Transports::Model::DestinationCollection->new(current_user => $system_user); |
36 |
$collection->unlimit; |
$collection->unlimit; |
37 |
is($collection->count, 4, "Finds two records"); |
is($collection->count, $nr + 2, "Finds two records"); |
38 |
|
|
39 |
# Searches in specific |
# Searches in specific |
40 |
$collection->limit(column => 'id', value => $o->id); |
$collection->limit(column => 'id', value => $o->id); |
47 |
|
|
48 |
# And the other one is still there |
# And the other one is still there |
49 |
$collection->unlimit; |
$collection->unlimit; |
50 |
is($collection->count, 3, "Still one left"); |
is($collection->count, $nr + 1, "Still one left"); |
51 |
|
|