Changeset 1071


Ignore:
Timestamp:
Jun 12, 2007, 10:56:36 PM (14 years ago)
Author:
Dominic Hargreaves
Message:

Refactor to use OpenGuides::Test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/t/17_commit_node.t

    r1070 r1071  
    55use OpenGuides::Feed;
    66use OpenGuides::Utils;
     7use OpenGuides::Test;
    78use Test::More;
    89
     
    5152   
    5253# Set up CGI parameters ready for a node write.
    53 # Most of these are in here to avoid uninitialised value warnings.
    54 my $q = CGI->new;
    55 $q->param( -name => "content", -value => "foo" );
    56 $q->param( -name => "categories", -value => "" );
    57 $q->param( -name => "locales", -value => "" );
    58 $q->param( -name => "phone", -value => "" );
    59 $q->param( -name => "fax", -value => "" );
    60 $q->param( -name => "website", -value => "" );
    61 $q->param( -name => "hours_text", -value => "" );
    62 $q->param( -name => "address", -value => "" );
    63 $q->param( -name => "postcode", -value => "" );
    64 $q->param( -name => "map_link", -value => "" );
    65 $q->param( -name => "os_x", -value => "" );
    66 $q->param( -name => "os_y", -value => "" );
    67 $q->param( -name => "username", -value => "bob" );
    68 $q->param( -name => "comment", -value => "foo" );
    69 $q->param( -name => "node_image", -value => "image" );
    70 $q->param( -name => "edit_type", -value => "Minor tidying" );
    71 $ENV{REMOTE_ADDR} = "127.0.0.1";
     54my $q = OpenGuides::Test->make_cgi_object(
     55    content => "foo",
     56    username => "bob",
     57    comment => "foo",
     58    node_image => "image",
     59    edit_type => "Minor tidying"
     60);
    7261
    7362my $output = $guide->commit_node(
     
    10089
    10190# Now try to commit some invalid data, and make sure we get an edit form back
    102 $q = CGI->new;
    103 $q->param( -name => "content", -value => "foo" );
    104 $q->param( -name => "categories", -value => "" );
    105 $q->param( -name => "locales", -value => "" );
    106 $q->param( -name => "phone", -value => "" );
    107 $q->param( -name => "fax", -value => "" );
    108 $q->param( -name => "website", -value => "" );
    109 $q->param( -name => "hours_text", -value => "" );
    110 $q->param( -name => "address", -value => "" );
    111 $q->param( -name => "postcode", -value => "" );
    112 $q->param( -name => "map_link", -value => "" );
    113 $q->param( -name => "os_x", -value => "fooooo" );
    114 $q->param( -name => "os_y", -value => "" );
    115 $q->param( -name => "username", -value => "bob" );
    116 $q->param( -name => "comment", -value => "foo" );
    117 $q->param( -name => "node_image", -value => "image" );
    118 $q->param( -name => "edit_type", -value => "Minor tidying" );
     91my $q = OpenGuides::Test->make_cgi_object(
     92    content => "foo",
     93    os_x => "fooooo",
     94    username => "bob",
     95    comment => "foo",
     96    node_image => "image",
     97    edit_type => "Minor tidying"
     98);
    11999
    120100$output = $guide->commit_node(
Note: See TracChangeset for help on using the changeset viewer.