RSS Limiter
This commit is contained in:
parent
a57a6ba87b
commit
e7a3282af3
6 changed files with 60 additions and 14 deletions
|
|
@ -32,7 +32,7 @@ use WebGUI::Asset::Wobject::Collaboration;
|
|||
use WebGUI::Asset::Post;
|
||||
use WebGUI::Asset::Wobject::Layout;
|
||||
use Data::Dumper;
|
||||
use Test::More tests => 4; # increment this value for each test you create
|
||||
use Test::More tests => 8; # increment this value for each test you create
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
|
|
@ -60,6 +60,38 @@ ok(defined $collab->get('groupToEditPost'), 'groupToEditPost field is defined');
|
|||
|
||||
# Verify sane defaults
|
||||
cmp_ok($collab->get('groupToEditPost'), 'eq', $collab->get('groupIdEdit'), 'groupToEditPost defaults to groupIdEdit correctly');
|
||||
is($collab->get('rssCapableRssLimit'), 10, 'rssCapableRssLimit is set to the default');
|
||||
|
||||
# finally, add the post to the collaboration system
|
||||
my $props = {
|
||||
className => 'WebGUI::Asset::Post::Thread',
|
||||
content => 'hello, world!',
|
||||
};
|
||||
my $post = $collab->addChild($props,
|
||||
undef,
|
||||
undef,
|
||||
{
|
||||
skipAutoCommitWorkflows => 1,
|
||||
});
|
||||
|
||||
# Test for a sane object type
|
||||
isa_ok($post, 'WebGUI::Asset::Post::Thread');
|
||||
|
||||
$props = {
|
||||
className => 'WebGUI::Asset::Post::Thread',
|
||||
content => 'jello, world!',
|
||||
};
|
||||
$post = $collab->addChild($props,
|
||||
undef,
|
||||
undef,
|
||||
{
|
||||
skipAutoCommitWorkflows => 1,
|
||||
});
|
||||
|
||||
my $rssitems = $collab->getRssItems();
|
||||
is($rssitems, 2, 'rssitems set to number of posts added');
|
||||
|
||||
is($collab->get('rssCapableRssLimit'), 10, 'rssCapableRssLimit is set to the default');
|
||||
|
||||
TODO: {
|
||||
local $TODO = "Tests to make later";
|
||||
|
|
|
|||
|
|
@ -74,7 +74,11 @@ $oldSettings{ specialState } = $session->setting->get( 'specialState' );
|
|||
$session->setting->set( 'specialState', '' );
|
||||
|
||||
my ( $mech );
|
||||
my $baseUrl = 'http://' . $session->config->get('sitename')->[0];
|
||||
my $config_port;
|
||||
if ($session->config->get('webServerPort')) {
|
||||
$config_port = $session->config->get('webServerPort') || 80;
|
||||
}
|
||||
my $baseUrl = 'http://' . $session->config->get('sitename')->[0] . ":$config_port";
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Tests
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue