front page rendering appears to work (given git zoom, dbixds and web-simple, anyway)
[catagits/App-IdiotBox.git] / t / show / front_page.t
CommitLineData
d7497a23 1use strict;
2use warnings FATAL => 'all';
3use Test::More;
4
5use App::IdiotBox;
6use Data::Perl::Collection::Set;
7
8my $idiotbox = App::IdiotBox->new({
9 config => { template_dir => 'share/html' }
10});
11
12my $ann = do {
13 my ($lpw, $opw) = map bless($_, 'App::IdiotBox::Bucket'),
14 { slug => 'lpw2009',
15 name => 'London Perl Workshop 2009',
16 video_count => 18 },
17 { slug => 'opw2010',
18 name => 'Perl Oasis 2010',
19 video_count => 6 };
20 my @ann = map bless($_, 'App::IdiotBox::Announcement'),
21 {
22 made_at => '2010-01-21 01:00:00',
23 bucket => $opw,
24 video_count => 3 },
25 {
26 made_at => '2010-01-01 14:00:00',
27 bucket => $lpw,
28 video_count => 5 };
29 Data::Perl::Collection::Set->new(members => [ @ann ]);
30};
31
32$idiotbox->{recent_announcements} = $ann;
33
34use Devel::Dwarn;
35
36#Dwarn
37
38my $front = $idiotbox->show_front_page;
39
40my $html = do {
41 my $string;
42 my $fh = $front->[-1];
43 while (defined (my $chunk = $fh->getline)) {
44 $string .= $chunk;
45 }
46 $string;
47};
48
49warn $html;
50
51pass;
52
53done_testing;
54
55#my %test;
56
57#HTML::Zoom->from_string($html)
58# ->with_selectors({
59# '.announcement' => [
60# -sub_selectors => {
61# selectors => [
62
63