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