You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
928 B
32 lines
928 B
#!/usr/bin/env perl
|
|
use MJB::Web::Test;
|
|
|
|
#==
|
|
# Test to ensure that the blog index page redirects to the page for
|
|
# creating the blog on a hosted page.
|
|
#==
|
|
|
|
my $t = Test::Mojo::MJB->new('MJB::Web');
|
|
|
|
# Ensure that a user who hasn't logged in cannot access this page.
|
|
$t->get_ok( '/blog' )
|
|
->status_is( 302 )
|
|
->header_is( location => '/login' );
|
|
|
|
# Make sure that open registration method is enabled and create a user account.
|
|
$t->app->config->{register}{enable_open} = 1;
|
|
$t->post_ok( '/register/open', form => {
|
|
name => 'fred',
|
|
email => 'fred@blog.com',
|
|
password => 'SuperSecure',
|
|
password_confirm => 'SuperSecure',
|
|
})
|
|
->status_is( 302 )
|
|
->get_ok( '/' );
|
|
|
|
# Confirm the blog index page redirects to the create blog hosted page.
|
|
$t->get_ok( '/blog' )
|
|
->status_is( 302 )
|
|
->header_is( location => '/blog/domain/hosted' );
|
|
|
|
done_testing();
|
|
|