Fixed testport bug
diff --git a/lib/Korap/Plugin/KorapTagHelpers.pm b/lib/Korap/Plugin/KorapTagHelpers.pm
index 8ceb679..0cd0364 100644
--- a/lib/Korap/Plugin/KorapTagHelpers.pm
+++ b/lib/Korap/Plugin/KorapTagHelpers.pm
@@ -26,7 +26,7 @@
# Tutorial wasn't embedded - but opened for testing
elsif ($c->param('testing') &&
- ($c->stash('test_port') || ($c->app->mode eq 'development')) &&
+ $c->stash('test_port') &&
$param{tests}) {
my $tests = $param{tests} // [];
diff --git a/lib/Korap/Tutorial.pm b/lib/Korap/Tutorial.pm
index f9d99da..e8726ee 100644
--- a/lib/Korap/Tutorial.pm
+++ b/lib/Korap/Tutorial.pm
@@ -4,6 +4,11 @@
sub page {
my $c = shift;
+ # Redundant in Search
+ $c->stash(test_port => (
+ $c->req->url->to_abs->port == 6666 ||
+ $c->app->mode =~ m/^development|test$/) ? 1 : 0);
+
if ($c->param('embedded')) {
$c->layout('snippet');
$c->stash(embedded => 1);