Scheduler: Fixed under warning, added some additional YAML tests
[catagits/Catalyst-Plugin-Scheduler.git] / t / 08yaml.t
index 6d7d7ea..e54efb1 100644 (file)
@@ -8,7 +8,7 @@ use lib "$FindBin::Bin/lib";
 use Test::More;
 use Storable qw/lock_store lock_retrieve/;
 
-plan tests => 3;
+plan tests => 6;
 use Catalyst::Test 'TestApp';
 
 our $STATE = "$FindBin::Bin/lib/TestApp/scheduler.state";
@@ -29,3 +29,11 @@ TestApp->config->{scheduler}->{yaml_file}
     unlink "$FindBin::Bin/lib/TestApp/every_minute.log";
 }
 
+# test that a YAML trigger works
+{
+    ok( my $res = request('http://localhost/?schedule_trigger=some_long_trigger_name'), 'request ok' );
+    is( $res->content, 'default', 'response ok' );
+    is( -e "$FindBin::Bin/lib/TestApp/every_minute.log", 1, 'every_minute executed ok' );
+    unlink "$FindBin::Bin/lib/TestApp/every_minute.log";
+}
+