Skip to content

Instantly share code, notes, and snippets.

@amiri
Created September 15, 2010 17:59
Show Gist options
  • Save amiri/581151 to your computer and use it in GitHub Desktop.
Save amiri/581151 to your computer and use it in GitHub Desktop.
use My::Community::Testing;
my $test = My::Community::Testing->new;
my $schema = $test->schema;
$schema->current_user($schema->resultset('User')->find({ username => 'Harry'}));
my $article_rs = $schema->resultset('Article');
isa_ok( $article_rs, 'DBIx::Class::ResultSet' );
my @articles = $article_rs->all;
my @results = map {
{ title => $_->title,
body => $_->body,
author => $_->author->username,
forum => $_->forum->name,
}
} @articles;
diag( Dumper(@results) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment