Ignore:
Timestamp:
Mar 6, 2007, 11:00:35 AM (14 years ago)
Author:
kake
Message:

Fix bug - ->categories was picking up out-of-date categories.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki-toolkit-plugin-categoriser/trunk/t/categoriser.t

    r261 r380  
    44
    55my $iterator = Wiki::Toolkit::TestLib->new_wiki_maker;
    6 plan tests => ( 1 + $iterator->number * 6 );
     6plan tests => ( 1 + $iterator->number * 7 );
    77
    88use_ok( "Wiki::Toolkit::Plugin::Categoriser" );
     
    4242    is_deeply( [ sort @categories ], [ "Pub Food", "Pubs" ],
    4343               "...->categories returns all categories" );
     44
     45    # Make sure we only look at current category data.
     46    my %node_data = $wiki->retrieve_node( "Calthorpe Arms" );
     47    $wiki->write_node( "Calthorpe Arms",
     48                       "Oh noes, they stopped doing food!",
     49                       $node_data{checksum},
     50                       { category => [ "Pubs" ] } )
     51      or die "Can't write node";
     52    @categories = $categoriser->categories( node => "Calthorpe Arms" );
     53    is_deeply( \@categories, [ "Pubs" ],
     54               "->categories ignores out-of-date data" );
    4455}
Note: See TracChangeset for help on using the changeset viewer.