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 |
{ |
169 |
new_values => { |
170 |
'permanent_location' => 'perm', |
171 |
'location' => 'loc' |
172 |
} |
173 |
} |
174 |
)->reset; |
175 |
|
176 |
$item = $item->get_from_storage; |
177 |
is( $item->permanent_location, 'perm', 'Updated as expected when value passed'); |
178 |
|
179 |
$items->batch_update( |
180 |
{ |
181 |
new_values => { |
182 |
'permanent_location' => '', |
183 |
'location' => 'new_loc' |
184 |
} |
185 |
} |
186 |
)->reset; |
187 |
|
188 |
$item = $item->get_from_storage; |
189 |
is( $item->permanent_location, 'perm', 'Permanent location not updated when mapped, so key present, but no value passed '); |
190 |
|
191 |
}; |
192 |
|
159 |
subtest 'regex' => sub { |
193 |
subtest 'regex' => sub { |
160 |
plan tests => 12; |
194 |
plan tests => 12; |
161 |
|
195 |
|