From: <bo...@tr...> - 2005-12-01 05:24:10
|
Log Message: ----------- Fixed bug by adding setting of $ENV{KRANG_PREVIEW_SCHEME} to honor SSL. Modified Files: -------------- krang/t: publish.t Revision Data ------------- Index: publish.t =================================================================== RCS file: /usr/local/krang-cvs/krang/t/publish.t,v retrieving revision 1.58 retrieving revision 1.59 diff -Lt/publish.t -Lt/publish.t -u -r1.58 -r1.59 --- t/publish.t +++ t/publish.t @@ -6,7 +6,7 @@ use File::Path; use Krang::ClassLoader 'Contrib'; use Krang::ClassLoader 'Pref'; -use Krang::ClassLoader Conf => qw(KrangRoot instance InstanceElementSet); +use Krang::ClassLoader Conf => qw(KrangRoot instance InstanceElementSet SSLEngine); use Krang::ClassLoader 'Site'; use Krang::ClassLoader 'Category'; use Krang::ClassLoader 'Story'; @@ -39,6 +39,9 @@ die $@ if $@; } +# Set preview scheme +my $scheme = $ENV{KRANG_PREVIEW_SCHEME} = SSLEngine eq 'on' ? 'https' : 'http'; + # instantiate publisher use_ok(pkg('Publisher')); @@ -1008,7 +1011,7 @@ $publisher->_set_preview_mode(); $story_href = $storylink->publish(element => $storylink, publisher => $publisher); - $resulting_link = '<a href="http://' . $dest_story->preview_url() . '">' . $dest_story->title() . '</a>'; + $resulting_link = "<a href=\"$scheme://" . $dest_story->preview_url() . '">' . $dest_story->title() . '</a>'; chomp ($story_href); ok($story_href eq $resulting_link, 'Krang::ElementClass::StoryLink->publish() -- preview w/ template'); @@ -1027,7 +1030,7 @@ $story_href = $storylink->publish(element => $storylink, publisher => $publisher); - ok($story_href eq 'http://' . $dest_story->preview_url(), 'Krang::ElementClass::StoryLink->publish() -- preview-no template'); + ok($story_href eq "$scheme://" . $dest_story->preview_url(), 'Krang::ElementClass::StoryLink->publish() -- preview-no template'); # re-deploy template. $publisher->deploy_template(template => $template_deployed{leadin}); @@ -1063,7 +1066,7 @@ $publisher->_set_preview_mode(); $media_href = $medialink->publish(element => $medialink, publisher => $publisher); - $resulting_link = '<img src="http://' . $media->preview_url() . '">' . $media->caption() . '<BR>' . $media->title(); + $resulting_link = "<img src=\"$scheme://" . $media->preview_url() . '">' . $media->caption() . '<BR>' . $media->title(); chomp ($media_href); ok($media_href eq $resulting_link, 'Krang::ElementClass::MediaLink->publish() -- preview w/ template'); @@ -1081,7 +1084,7 @@ $media_href = $medialink->publish(element => $medialink, publisher => $publisher); - ok($media_href eq "http://" . $media->preview_url(), 'Krang::ElementClass::MediaLink->publish() -- preview-no template'); + ok($media_href eq "$scheme://" . $media->preview_url(), 'Krang::ElementClass::MediaLink->publish() -- preview-no template'); # re-deploy template. $publisher->deploy_template(template => $template_deployed{photo}); |