summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-12-20 16:17:15 +0100
committerDaniel Friesel <derf@finalrewind.org>2014-12-20 16:17:15 +0100
commit2740b486e0df5ea08d33b5bed65e23d1233baa9d (patch)
treeb0043dd1c9a3f5b38cc44e556f8ba4f49609b052 /t
parent50df6aa76dca9440f4aaeb86ab6893366bcef296 (diff)
add basic ris test
Diffstat (limited to 't')
-rw-r--r--t/31-clean-ris.t31
1 files changed, 31 insertions, 0 deletions
diff --git a/t/31-clean-ris.t b/t/31-clean-ris.t
new file mode 100644
index 0000000..b410707
--- /dev/null
+++ b/t/31-clean-ris.t
@@ -0,0 +1,31 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use 5.014;
+use Test::More;
+use Test::Mojo;
+
+use FindBin;
+require "$FindBin::Bin/../index.pl";
+
+my $t = Test::Mojo->new;
+
+# Note: These tests depends on RIS live data. If it fails, it -might- also
+# be because of RIS problems or unanticipated schedule changes.
+# TODO: Support mock XML from hard disk.
+
+$t->get_ok('/Dortmund Universitat')
+ ->status_is(200)
+ ->content_like(qr{S 1}, 'train name')
+ ->content_like(qr{Dortmund Hbf}, 'dest')
+ ->content_like(qr{Dortmund-Oespel}, 'via')
+ ;
+
+$t->get_ok('/Dortmund Universitat&backend=ris')
+ ->status_is(200)
+ ->content_like(qr{S 1}, 'train name')
+ ->content_like(qr{Dortmund Hbf}, 'dest')
+ ->content_like(qr{Dortmund-Oespel}, 'via')
+ ;
+
+done_testing();