commit changes before switch to new zoom API
[catagits/App-IdiotBox.git] / t / show / front_page.t
1 use strict;
2 use warnings FATAL => 'all';
3 use Test::More;
4
5 use App::IdiotBox;
6 use Data::Perl::Collection::Set;
7
8 BEGIN { $INC{"App/IdiotBox/Store/Test.pm"} = __FILE__ }
9
10 sub App::IdiotBox::Store::Test::bind {}
11
12 my $idiotbox = App::IdiotBox->new({
13   config => {
14     store => 'Test'
15   }
16 });
17
18 my $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
40 use Devel::Dwarn;
41
42 #Dwarn
43
44 my $front = $idiotbox->show_front_page;
45
46 my $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
55 warn $html;
56
57 pass;
58
59 done_testing;
60
61 #my %test;
62
63 #HTML::Zoom->from_string($html)
64 #          ->with_selectors({
65 #              '.announcement' => [
66 #                -sub_selectors => {
67 #                  selectors => [
68                     
69