Changeset 1867

Show
Ignore:
Timestamp:
04/11/08 19:24:55 (4 months ago)
Author:
mpaschal
Message:

Test favorite_blogs metadata too

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/feature-narrow-tables/t/22-author.t

    r1848 r1867  
    88use lib 'extlib'; 
    99 
    10 use Test::More tests => 60
     10use Test::More tests => 64
    1111 
    1212use MT; 
     
    6363ok(eval { $author->widgets(); 1 }, 'Author obj has widgets accessor'); 
    6464ok(!defined $author->widgets, "Author's widgets are undefined by default"); 
     65ok(!defined $author->favorite_blogs, "Author's favorite blogs are undefined by default"); 
    6566 
    6667    # same as in MT::CMS::Dashboard, but that's not necessary 
     
    7374    }; 
    7475 
     76my $fav_blogs = [1, 7];  # not actually a blog #7, but meh 
     77 
    7578ok($author->widgets($default_widgets), "Author's widgets can be set"); 
     79ok($author->favorite_blogs($fav_blogs), "Author's favorite blogs can be set"); 
    7680ok($author->save(), "Author with modified widgets can be saved"); 
    7781 
     
    8084 
    8185$author = MT::Author->load({ name => 'Chuck D' }); 
     86 
    8287ok($author->widgets, "Modified author has widgets"); 
    83 diag(Data::Dumper::Dumper($author->widgets)); 
    8488is_deeply($author->widgets, $default_widgets, "Author's widgets survived being saved accurately"); 
     89 
     90ok($author->favorite_blogs, "Modified author has favorite blogs"); 
     91is_deeply($author->favorite_blogs, $fav_blogs, "Author's favorite blogs survived being saved accurately"); 
    8592} 
    8693