Lines 16-22
Link Here
|
16 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
16 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
use Test::More tests=> 8; |
19 |
use Test::More tests=> 9; |
20 |
use Test::Warn; |
20 |
use Test::Warn; |
21 |
use utf8; |
21 |
use utf8; |
22 |
|
22 |
|
Lines 156-161
subtest 'blank' => sub {
Link Here
|
156 |
|
156 |
|
157 |
}; |
157 |
}; |
158 |
|
158 |
|
|
|
159 |
subtest 'permanent_location' => sub { |
160 |
|
161 |
# This is a special case as some libraries add this field in the frameworks |
162 |
# to allow explicitly setting a temporary location. |
163 |
# When mapped an empty value is submitted in the form with the key of permanent_location |
164 |
|
165 |
plan tests => 2; |
166 |
|
167 |
$items->batch_update({ |
168 |
new_values => { |
169 |
'permanent_location' => 'perm', |
170 |
'location' => 'loc' |
171 |
} |
172 |
}); |
173 |
$items->reset; |
174 |
|
175 |
$item = $item->get_from_storage; |
176 |
is( $item->permanent_location, 'perm', 'Updated as expected when value passed'); |
177 |
|
178 |
$items->batch_update({ |
179 |
new_values => { |
180 |
'permanent_location' => '', |
181 |
'location' => 'new_loc' |
182 |
} |
183 |
}); |
184 |
$items->reset; |
185 |
|
186 |
$item = $item->get_from_storage; |
187 |
is( $item->permanent_location, 'perm', 'Permanent location not updated when mapped, so key present, but no value passed '); |
188 |
|
189 |
}; |
190 |
|
159 |
subtest 'regex' => sub { |
191 |
subtest 'regex' => sub { |
160 |
plan tests => 12; |
192 |
plan tests => 12; |
161 |
|
193 |
|