|
Lines 3356-3367
subtest 'current_branchtransfers relationship' => sub {
Link Here
|
| 3356 |
|
3356 |
|
| 3357 |
subtest 'location_update_trigger() tests' => sub { |
3357 |
subtest 'location_update_trigger() tests' => sub { |
| 3358 |
|
3358 |
|
| 3359 |
plan tests => 12; |
3359 |
plan tests => 18; |
| 3360 |
|
3360 |
|
| 3361 |
$schema->storage->txn_begin; |
3361 |
$schema->storage->txn_begin; |
| 3362 |
|
3362 |
|
| 3363 |
my $location = 'YA'; |
3363 |
my $location = 'YA'; |
| 3364 |
my $permanent_location = 'HEY'; |
3364 |
my $permanent_location = 'HEY'; |
|
|
3365 |
my $another_location = 'SAUNA'; |
| 3365 |
|
3366 |
|
| 3366 |
foreach my $action (qw{ checkin checkout }) { |
3367 |
foreach my $action (qw{ checkin checkout }) { |
| 3367 |
|
3368 |
|
|
Lines 3416-3421
subtest 'location_update_trigger() tests' => sub {
Link Here
|
| 3416 |
$item->location, $permanent_location, |
3417 |
$item->location, $permanent_location, |
| 3417 |
q{_PERM_ does the job"} |
3418 |
q{_PERM_ does the job"} |
| 3418 |
); |
3419 |
); |
|
|
3420 |
|
| 3421 |
t::lib::Mocks::mock_preference( $pref, qq{$location: $another_location\n_BLANK_: $permanent_location\n_DEFAULT_: $location } ); |
| 3422 |
$item->location($location)->store; |
| 3423 |
$item->location_update_trigger($action); |
| 3424 |
is( $item->location, $another_location, qq{'location' value set from '$location' to '$another_location' with setting `$location: $another_location`} ); |
| 3425 |
|
| 3426 |
$item->location('')->store; |
| 3427 |
$item->location_update_trigger($action); |
| 3428 |
is( $item->location, $permanent_location, qq{'location' value set from '' to '$permanent_location' with setting `_BLANK_: $permanent_location`} ); |
| 3429 |
|
| 3430 |
$item->location($permanent_location)->store; |
| 3431 |
$item->location_update_trigger($action); |
| 3432 |
is( $item->location, $location, qq{'location' value set from '$permanent_location' to '$location' with setting `_DEFAULT_: $location`} ); |
| 3433 |
|
| 3419 |
} |
3434 |
} |
| 3420 |
|
3435 |
|
| 3421 |
$schema->storage->txn_rollback; |
3436 |
$schema->storage->txn_rollback; |
| 3422 |
- |
|
|