Add in Data::Perl::Collection::Set from DBIx-Data-Store-old so we can run tests.
[catagits/App-IdiotBox.git] / t / show / front_page.t
1 use strict;
2 use lib qw(t/lib);
3 use warnings FATAL => 'all';
4 use Test::More;
5
6 use App::IdiotBox;
7 use Data::Perl::Collection::Set;
8
9 BEGIN { $INC{"App/IdiotBox/Store/Test.pm"} = __FILE__ }
10
11 sub App::IdiotBox::Store::Test::bind {}
12
13 my $idiotbox = App::IdiotBox->new({
14   config => {
15     store => 'Test'
16   }
17 });
18
19 my $ann = do {
20   my ($lpw, $opw) = map bless($_, 'App::IdiotBox::Bucket'),
21     { slug => 'lpw2009',
22       name => 'London Perl Workshop 2009',
23       video_count => 18 },
24     { slug => 'opw2010',
25       name => 'Perl Oasis 2010',
26       video_count => 6 };
27   my @ann = map bless($_, 'App::IdiotBox::Announcement'),
28     {
29       made_at => '2010-01-21 01:00:00',
30       bucket => $opw,
31       video_count => 3 },
32     {
33       made_at => '2010-01-01 14:00:00',
34       bucket => $lpw,
35       video_count => 5 };
36   Data::Perl::Collection::Set->new(members => [ @ann ]);
37 };
38
39 $idiotbox->{recent_announcements} = $ann;
40
41 use Devel::Dwarn;
42
43 #Dwarn
44
45 my $front = $idiotbox->show_front_page;
46
47 my $html = do {
48   my $string;
49   my $fh = $front->[-1];
50   while (defined (my $chunk = $fh->getline)) {
51     $string .= $chunk;
52   }
53   $string;
54 };
55
56 warn $html;
57
58 pass;
59
60 done_testing;
61
62 #my %test;
63
64 #HTML::Zoom->from_string($html)
65 #          ->with_selectors({
66 #              '.announcement' => [
67 #                -sub_selectors => {
68 #                  selectors => [
69                     
70