summaryrefslogtreecommitdiff
path: root/t/31-clean-ris.t
blob: b4107073d66ec27b28f2f877499e05a8fd382a3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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();