Improve and test support for customized templates
Change-Id: I7209c247b01dc06078d84c18e0a7beed80c6a62c
diff --git a/t/basic.t b/t/basic.t
index 2bdd9cf..0bbc09e 100644
--- a/t/basic.t
+++ b/t/basic.t
@@ -1,7 +1,7 @@
use Mojo::Base -strict;
-use lib '../lib', 'lib';
use Test::More;
use Test::Mojo;
+use Mojo::File qw/path/;
my $t = Test::Mojo->new('Kalamar');
@@ -10,7 +10,28 @@
$t->get_ok('/')
->status_is(200)
->text_is('title', 'KorAP - Corpus Analysis Platform')
- ->text_is('h1 span', 'KorAP - Corpus Analysis Platform');
+ ->text_is('h1 span', 'KorAP - Corpus Analysis Platform')
+ ->element_exists('div.intro')
+ ->text_is('div.intro > p > strong', 'KorAP')
+ ;
+
+push @{$t->app->renderer->paths}, path(path(__FILE__)->dirname);
+
+$t->app->plugin(Localize => {
+ dict => {
+ Template => {
+ intro => 'custom/intro'
+ }
+ },
+ override => 1
+});
+
+$t->get_ok('/')
+ ->status_is(200)
+ ->text_is('title', 'KorAP - Corpus Analysis Platform')
+ ->text_is('h1 span', 'KorAP - Corpus Analysis Platform')
+ ->element_exists('div.intro')
+ ->text_is('div.intro h2', 'This is a custom intro page!');
$t->get_ok('/huhuhuhuhu')
->status_is(404)