# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
+use utf8;
use Koha::Database;
use_ok("Koha::Item::Templates");
subtest 'get_available' => sub {
- plan tests => 2;
+ plan tests => 3;
$schema->storage->txn_begin;
{
patron_id => $patron_2->id,
name => 'My template',
- contents => { location => 'test' },
+ contents => { location => 'test๐' },
is_shared => 0,
}
- )->store();
+ )->store;
+ $unshared_template->discard_changes; # refresh
+ is( $unshared_template->decoded_contents->{location}, 'test๐', 'Tested encoding/decoding' );
my $templates = Koha::Item::Templates->get_available( $patron_1->id );
is( $templates->{owned}->count, 1, "Got back one owned template" );