Test default label handling.

This commit is contained in:
Colin Kuskie 2010-09-30 10:45:54 -07:00
parent ee1e896ef8
commit be35b8afe4
2 changed files with 24 additions and 2 deletions

View file

@ -133,6 +133,20 @@ is (WebGUI::Shop::PayDriver->getName($session), 'Payment Driver', 'getName retur
can_ok $driver, qw/get set update write getName className label enabled paymentGatewayId groupToUse/;
#######################################################################
#
# default label
#
#######################################################################
$driver->label('');
is $driver->label, $driver->getName($session), 'empty label replaced with plugin name';
$driver->label('untitled');
is $driver->label, $driver->getName($session), 'label=untitled replaced with plugin name';
$driver->label('uNtItLeD');
is $driver->label, $driver->getName($session), '...regardless of case';
$driver->label('Fast and harmless');
#######################################################################
#
# get
@ -147,7 +161,6 @@ cmp_deeply(
%{ $options },
paymentGatewayId => ignore(),
},
$options,
'get works like the options method with no param passed'
);
is ($driver->get('label'), 'Fast and harmless', 'get the label entry from the options');