commit changes before switch to new zoom API
[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
71a02d85 8BEGIN { $INC{"App/IdiotBox/Store/Test.pm"} = __FILE__ }
9
10sub App::IdiotBox::Store::Test::bind {}
11
d7497a23 12my $idiotbox = App::IdiotBox->new({
71a02d85 13 config => {
14 store => 'Test'
15 }
d7497a23 16});
17
18my $ann = do {
19 my ($lpw, $opw) = map bless($_, 'App::IdiotBox::Bucket'),
20 { slug => 'lpw2009',
21 name => 'London Perl Workshop 2009',
22 video_count => 18 },
23 { slug => 'opw2010',
24 name => 'Perl Oasis 2010',
25 video_count => 6 };
26 my @ann = map bless($_, 'App::IdiotBox::Announcement'),
27 {
28 made_at => '2010-01-21 01:00:00',
29 bucket => $opw,
30 video_count => 3 },
31 {
32 made_at => '2010-01-01 14:00:00',
33 bucket => $lpw,
34 video_count => 5 };
35 Data::Perl::Collection::Set->new(members => [ @ann ]);
36};
37
38$idiotbox->{recent_announcements} = $ann;
39
40use Devel::Dwarn;
41
42#Dwarn
43
44my $front = $idiotbox->show_front_page;
45
46my $html = do {
47 my $string;
48 my $fh = $front->[-1];
49 while (defined (my $chunk = $fh->getline)) {
50 $string .= $chunk;
51 }
52 $string;
53};
54
55warn $html;
56
57pass;
58
59done_testing;
60
61#my %test;
62
63#HTML::Zoom->from_string($html)
64# ->with_selectors({
65# '.announcement' => [
66# -sub_selectors => {
67# selectors => [
68
69