]> iEval git - gruntmaster-page.git/blame_incremental - t/mech.t
Add Rust, Julia, Brainfuck, PHP, OCaml and D
[gruntmaster-page.git] / t / mech.t
... / ...
CommitLineData
1#!/usr/bin/perl -w
2use strict;
3use warnings;
4
5use Test::More;
6use Test::WWW::Mechanize::PSGI;
7
8use Gruntmaster::Data;
9use JSON::MaybeXS qw/decode_json/;
10use Log::Log4perl qw/:easy/;
11
12BEGIN {
13 eval {
14 dbinit 'dbi:Pg:dbname=gmtest'; 1;
15 } or plan skip_all => 'Cannot connect to test database (gmtest).'. "Error: $@";
16 plan tests => 22;
17}
18
19Log::Log4perl->easy_init($OFF);
20my $mech = Test::WWW::Mechanize::PSGI->new(app => do 'app.psgi');
21
22$mech->get_ok('/');
23$mech->title_is('Gruntmaster 6000', 'title');
24
25$mech->get_ok('/pb/');
26$mech->title_is('Problems', 'title');
27
28$mech->get_ok('/pb/arc');
29$mech->title_is('Problem in archive', 'title');
30
31$mech->get_ok('/ct/');
32$mech->title_is('Contests', 'title');
33
34$mech->get_ok('/ct/fc');
35$mech->title_is('Finished contest');
36
37$mech->get_ok('/log/');
38$mech->title_is('Job log', 'title');
39
40$mech->get_ok('/log/1');
41$mech->title_is('Job 1', 'title');
42
43$mech->get_ok('/us/');
44$mech->title_is('Users', 'title');
45
46$mech->get_ok('/us/MGV');
47# testdata.sql does not set name for users, therefore not checking title
48#$mech->title_is('Marius Gavrilescu', 'title');
49
50$mech->get_ok('/src/1.c');
51
52$mech->get_ok('/st/fc');
53$mech->title_is('Standings', 'title');
54
55$mech->get_ok('/ed/fc');
56$mech->title_is('Editorial of Finished contest', 'title');
This page took 0.020527 seconds and 4 git commands to generate.