# Copyright (c) 2006 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: BlogEditForm.bunit,v 1.7 2009/11/19 00:03:51 nagler Exp $ my($this); FormModel({ setup_request => sub { req()->put(query => {this => $this}); return; }, }); require 'Blog.PL'; my($entry) = [map( +{ title => "Edit $_ Title", body => "Edit\nbody $_\n", 'RealmFile.is_public' => $_, }, 0, 1, )]; model('BlogCreateForm')->process($entry->[0]); $this = Type_BlogFileName()->from_absolute(req(qw(Model.RealmFile path))); [ empty_case($entry->[0]), map({ my($x) = $_; ([$entry->[$x]] => [{ 'Model.RealmFile' => { path => sub { assert_equals( Type_BlogContent()->join( @{$entry->[$x]}{qw(title body)}, ), req('Model.RealmFile')->get_content, ); return Type_BlogFileName()->to_absolute($this, $x); }, is_public => $x, }, }]); } 1, 0), ];