Skip to content

Commit

Permalink
Test a module which has no co-maint.
Browse files Browse the repository at this point in the history
  • Loading branch information
oalders committed Apr 2, 2017
1 parent 5c4b7ac commit 03f4af6
Showing 1 changed file with 33 additions and 17 deletions.
50 changes: 33 additions & 17 deletions t/server/controller/permission.t
Expand Up @@ -12,23 +12,39 @@ $server->index_permissions;
test_psgi app, sub {
my $cb = shift;

my $module_name = 'CPAN::Test::Dummy::Perl5::VersionBump';
ok( my $res = $cb->( GET "/permission/$module_name" ),
"GET $module_name" );
is( $res->code, 200, '200 OK' );

# The fakecpan 06perms doesn't have any authors who have co-maint, so can't
# test that right now.

is_deeply(
decode_json( $res->content ),
{
co_maintainers => ['OALDERS'],
module_name => $module_name,
owner => 'MIYAGAWA',
},
'Owned by MIYAGAWA'
);
{
my $module_name = 'CPAN::Test::Dummy::Perl5::VersionBump';
ok( my $res = $cb->( GET "/permission/$module_name" ),
"GET $module_name" );
is( $res->code, 200, '200 OK' );

is_deeply(
decode_json( $res->content ),
{
co_maintainers => ['OALDERS'],
module_name => $module_name,
owner => 'MIYAGAWA',
},
'Owned by MIYAGAWA, OALDERS has co-maint'
);
}

# Pod::Examples,RWSTAUNER,f
{
my $module_name = 'Pod::Examples';
ok( my $res = $cb->( GET "/permission/$module_name" ),
"GET $module_name" );
is( $res->code, 200, '200 OK' );

is_deeply(
decode_json( $res->content ),
{
module_name => $module_name,
owner => 'RWSTAUNER',
},
'Owned by RWSTAUNER, no co-maint'
);
}
};

done_testing;

0 comments on commit 03f4af6

Please sign in to comment.