A hosting service for Jekyll Blogs
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.
 
 
 
 
 
 

31 lines
912 B

#!/usr/bin/env perl
use MJB::Web::Test;
#==
# Ensure that the route for creating a blog on an owned domain behaves
# as expected. Anonymouse users should be dismissed to the login 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/domain/owned' )
->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 that the page exists and is served.
$t->get_ok( '/blog/domain/owned' )
->status_is( 200 );
done_testing();