Lines 2302-2308
subtest 'current_branchtransfers relationship' => sub {
Link Here
|
2302 |
$schema->storage->txn_rollback; |
2302 |
$schema->storage->txn_rollback; |
2303 |
}; |
2303 |
}; |
2304 |
|
2304 |
|
2305 |
subtest 'update_item_location() tests' => sub { |
2305 |
subtest 'location_update_trigger() tests' => sub { |
2306 |
|
2306 |
|
2307 |
plan tests => 10; |
2307 |
plan tests => 10; |
2308 |
|
2308 |
|
Lines 2320-2345
subtest 'update_item_location() tests' => sub {
Link Here
|
2320 |
|
2320 |
|
2321 |
my $item = $builder->build_sample_item( { location => $location, permanent_location => $permanent_location } ); |
2321 |
my $item = $builder->build_sample_item( { location => $location, permanent_location => $permanent_location } ); |
2322 |
|
2322 |
|
2323 |
$item->update_item_location($action); |
2323 |
$item->location_update_trigger($action); |
2324 |
|
2324 |
|
2325 |
is( $item->location, $location, "$pref does not modify value when not enabled" ); |
2325 |
is( $item->location, $location, "$pref does not modify value when not enabled" ); |
2326 |
|
2326 |
|
2327 |
t::lib::Mocks::mock_preference( $pref, qq{$location: GEN} ); |
2327 |
t::lib::Mocks::mock_preference( $pref, qq{$location: GEN} ); |
2328 |
|
2328 |
|
2329 |
$item->update_item_location($action); |
2329 |
$item->location_update_trigger($action); |
2330 |
|
2330 |
|
2331 |
is( $item->location, 'GEN', qq{'location' value set from '$location' to 'GEN' with setting `$location: GEN`} ); |
2331 |
is( $item->location, 'GEN', qq{'location' value set from '$location' to 'GEN' with setting `$location: GEN`} ); |
2332 |
|
2332 |
|
2333 |
t::lib::Mocks::mock_preference( $pref, q{_ALL_: BOO} ); |
2333 |
t::lib::Mocks::mock_preference( $pref, q{_ALL_: BOO} ); |
2334 |
|
2334 |
|
2335 |
$item->update_item_location($action); |
2335 |
$item->location_update_trigger($action); |
2336 |
|
2336 |
|
2337 |
is( $item->location, 'BOO', q{`_ALL_` does the job} ); |
2337 |
is( $item->location, 'BOO', q{`_ALL_` does the job} ); |
2338 |
|
2338 |
|
2339 |
t::lib::Mocks::mock_preference( $pref, qq{$location: _BLANK_} ); |
2339 |
t::lib::Mocks::mock_preference( $pref, qq{$location: _BLANK_} ); |
2340 |
$item->location($location)->store(); |
2340 |
$item->location($location)->store(); |
2341 |
|
2341 |
|
2342 |
$item->update_item_location($action); |
2342 |
$item->location_update_trigger($action); |
2343 |
is( $item->location, q{}, q{`_BLANK_` does the job} ); |
2343 |
is( $item->location, q{}, q{`_BLANK_` does the job} ); |
2344 |
|
2344 |
|
2345 |
t::lib::Mocks::mock_preference( $pref, qq{GEN: _BLANK_\n_BLANK_: PROC\n$location: _PERM_} ); |
2345 |
t::lib::Mocks::mock_preference( $pref, qq{GEN: _BLANK_\n_BLANK_: PROC\n$location: _PERM_} ); |
Lines 2352-2358
subtest 'update_item_location() tests' => sub {
Link Here
|
2352 |
} |
2352 |
} |
2353 |
)->store; |
2353 |
)->store; |
2354 |
|
2354 |
|
2355 |
$item->update_item_location($action); |
2355 |
$item->location_update_trigger($action); |
2356 |
|
2356 |
|
2357 |
is( |
2357 |
is( |
2358 |
$item->location, $permanent_location, |
2358 |
$item->location, $permanent_location, |
2359 |
- |
|
|