root/branches/new-install-process/t/20_edit_form.t

Revision 1031, 1.2 kB (checked in by kake, 20 months ago)

Omit footer search form from edit form.

Line 
1use strict;
2use OpenGuides;
3use OpenGuides::Test;
4use Test::More;
5use Wiki::Toolkit::Setup::SQLite;
6
7eval { require DBD::SQLite; };
8if ( $@ ) {
9    my ($error) = $@ =~ /^(.*?)\n/;
10    plan skip_all => "DBD::SQLite could not be used - no database to test with ($error)";
11}
12
13eval { require Test::HTML::Content; };
14if ( $@ ) {
15    plan skip_all => "Test::HTML::Content not installed";
16}
17
18plan tests => 1;
19
20# Clear out the database from any previous runs.
21unlink "t/node.db";
22unlink <t/indexes/*>;
23Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
24
25my $config = OpenGuides::Test->make_basic_config;
26my $guide = OpenGuides->new( config => $config );
27
28# Make sure the edit form doesn't display a search form.
29my $output = $guide->display_edit_form(
30                                        id => "Crabtree Tavern",
31                                        return_output => 1,
32                                      );
33                                       
34# Strip Content-Type header to stop Test::HTML::Content getting confused.
35$output =~ s/^Content-Type.*[\r\n]+//m;
36
37Test::HTML::Content::no_tag( $output, "div", { id => "search_form" },
38                             "edit form doesn't contain search form" );
Note: See TracBrowser for help on using the browser.