parent
e58e849906
commit
dc4c4674f4
1 changed files with 38 additions and 0 deletions
@ -0,0 +1,38 @@ |
||||
#!/usr/bin/env perl |
||||
use MJB::Web::Test; |
||||
|
||||
#== |
||||
# This test ensures that the jobs panel for the blog can be viewed. |
||||
# |
||||
# 1. Create user and login. |
||||
# 2. Make a new blog. |
||||
# 3. Go to the jobs panel |
||||
#== |
||||
|
||||
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/jobs" ) |
||||
->status_is( 200 ); |
||||
|
||||
#== |
||||
# Remove Jekyll blog repos that were created as a part of this test. |
||||
#== |
||||
$t->clear_tempdir; |
||||
|
||||
done_testing; |
||||
Loading…
Reference in new issue