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.
 
 
 
 
 
 

43 lines
1.0 KiB

#!/usr/bin/env perl
use MJB::Web::Test;
#==
# Initialize Testing Database
#==
MJB::Web::Test::enable_testing_database();
#==
# This test ensures that a blog page creator panel can be viewed..
#
# 1. Create user and login.
# 2. Make a new blog.
# 3. Go to the blog page creator
#==
my $t = Test::Mojo::MJB->new('MJB::Web');
my $blog_id = $t->create_user
->post_ok( '/blog/domain', form => {
domain => 'blog.example.com',
calling_route => 'show_blog_domain_owned',
})
->get_ok( '/dashboard' )
->stash->{blogs}->[0]->id;
$t->get_ok( "/dashboard/blog/$blog_id" )
->status_is( 200 )
->code_block( sub {
my $self = shift;
ok exists $self->stash->{blog}, "The blog loads!";
is $self->stash->{blog}->domain->name, 'blog.example.com', "Correct domain name for id.";
});
$t->get_ok( "/dashboard/blog/$blog_id/page" )
->status_is( 200 );
#==
# Remove Jekyll blog repos that were created as a part of this test.
#==
$t->clear_tempdir;
done_testing;