|
Revision 1031, 1.2 kB
(checked in by kake, 19 months ago)
|
|
Omit footer search form from edit form.
|
| Line | |
|---|
| 1 | use strict; |
|---|
| 2 | use OpenGuides; |
|---|
| 3 | use OpenGuides::Test; |
|---|
| 4 | use Test::More; |
|---|
| 5 | use Wiki::Toolkit::Setup::SQLite; |
|---|
| 6 | |
|---|
| 7 | eval { require DBD::SQLite; }; |
|---|
| 8 | if ( $@ ) { |
|---|
| 9 | my ($error) = $@ =~ /^(.*?)\n/; |
|---|
| 10 | plan skip_all => "DBD::SQLite could not be used - no database to test with ($error)"; |
|---|
| 11 | } |
|---|
| 12 | |
|---|
| 13 | eval { require Test::HTML::Content; }; |
|---|
| 14 | if ( $@ ) { |
|---|
| 15 | plan skip_all => "Test::HTML::Content not installed"; |
|---|
| 16 | } |
|---|
| 17 | |
|---|
| 18 | plan tests => 1; |
|---|
| 19 | |
|---|
| 20 | # Clear out the database from any previous runs. |
|---|
| 21 | unlink "t/node.db"; |
|---|
| 22 | unlink <t/indexes/*>; |
|---|
| 23 | Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } ); |
|---|
| 24 | |
|---|
| 25 | my $config = OpenGuides::Test->make_basic_config; |
|---|
| 26 | my $guide = OpenGuides->new( config => $config ); |
|---|
| 27 | |
|---|
| 28 | # Make sure the edit form doesn't display a search form. |
|---|
| 29 | my $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 | |
|---|
| 37 | Test::HTML::Content::no_tag( $output, "div", { id => "search_form" }, |
|---|
| 38 | "edit form doesn't contain search form" ); |
|---|