19 |
|
|
20 |
# Try testing a create |
# Try testing a create |
21 |
my $o = Transports::Model::User->new(current_user => $system_user); |
my $o = Transports::Model::User->new(current_user => $system_user); |
22 |
my ($id) = $o->create(); |
my ($id) = $o->create( |
23 |
|
name => 'Foo Bar', |
24 |
|
email => 'foo.bar@example.com', |
25 |
|
password => 'foo123', |
26 |
|
); |
27 |
ok($id, "User create returned success"); |
ok($id, "User create returned success"); |
28 |
ok($o->id, "New User has valid id set"); |
ok($o->id, "New User has valid id set"); |
29 |
is($o->id, $id, "Create returned the right id"); |
is($o->id, $id, "Create returned the right id"); |
30 |
|
|
31 |
# And another |
# And another |
32 |
$o->create(); |
$o->create( |
33 |
|
name => 'Baz Bar', |
34 |
|
email => 'baz.bar@example.com', |
35 |
|
password => 'baz123', |
36 |
|
); |
37 |
ok($o->id, "User create returned another value"); |
ok($o->id, "User create returned another value"); |
38 |
isnt($o->id, $id, "And it is different from the previous one"); |
isnt($o->id, $id, "And it is different from the previous one"); |
39 |
|
|