Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (31 sloc) 876 Bytes
package Test::Lystyng::Schema::Result::User;
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 $user = $user_rs->create({
username => 'user',
password => 'pass',
email => '',
ok($user, 'Got a user');
isa_ok($user, 'Lystyng::Schema::Result::User');
my ($user2) = $user_rs->search({
username => 'user',
ok($user, 'Got another user');
isa_ok($user, 'Lystyng::Schema::Result::User');
foreach (qw[username password email]) {
is($user->$_, $user2->$_, "$_ is correct");
$user2->password('another password');
# re-read from db
is($user2->password, 'another password', 'Updated password is correct');
Jump to Line
Something went wrong with that request. Please try again.