# Copyright (c) 2003-2007 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: MIMEEntityRealmFile.bunit,v 1.6 2007/10/24 21:16:59 aviggio Exp $ Widget({ check_return => sub { my(undef, undef, $expect) = @_; my($e) = [split(/\|/, $expect->[0])]; my($merf, $attr) = req()->get_by_regexp(qr{MIMEEntityRealmFile}); req()->delete($attr); my($mh) = $merf->head; foreach my $a (qw(content-type content-transfer-encoding content-disposition content-id)) { next unless my $av = $mh->get($a); assert_equals(shift(@$e). "\n", $av); } return 1; }, }); req()->set_realm_and_user('btest_read'); req()->put( map( ($_ => model('RealmFile', { realm_id => req('auth_id'), path => "/private/$_", })), 'image.gif', 'file.html', ), ); [ [['image.gif']] => 'image/gif; name="image.gif"|base64|attachment; filename="image.gif"', [['file.html'], { mime_disposition => 'inline', mime_id => '1.1@a.a', }] => 'text/html; name="file.html"|7bit|inline; filename="file.html"|<1.1@a.a>', ];