diff options
author | Marius Halden <marius.h@lden.org> | 2017-05-28 21:31:42 +0200 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2017-05-28 21:31:42 +0200 |
commit | 987124b09a32248414faf4d0d6615d43b29ac6f6 (patch) | |
tree | a549db8af723c981d3b346e855f25d6fd5ff8aa7 /t/cobrand/seesomething.t | |
parent | dbf56159e44c1560a413022451bf1a1c4cb22a52 (diff) | |
parent | a085b63ce09f87e83b75cda9b9cd08aadfe75d61 (diff) |
Merge tag 'v2.0.4' into fiksgatami-dev
Diffstat (limited to 't/cobrand/seesomething.t')
-rw-r--r-- | t/cobrand/seesomething.t | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/t/cobrand/seesomething.t b/t/cobrand/seesomething.t deleted file mode 100644 index 4da1c9c6e..000000000 --- a/t/cobrand/seesomething.t +++ /dev/null @@ -1,87 +0,0 @@ -use strict; -use warnings; -use DateTime; -use Test::More; - -use FixMyStreet; -use FixMyStreet::TestMech; - -my $EMAIL = 'seesomething@example.com'; - -my $mech = FixMyStreet::TestMech->new; -my $db = FixMyStreet::DB->storage->schema; -my $dt_parser = $db->storage->datetime_parser; - -$db->txn_begin; - -$db->resultset('Comment')->delete; -$db->resultset('Problem')->delete; - -my $user = $mech->create_user_ok( $EMAIL ); - -my $body = $mech->create_body_ok( 2520, 'Coventry City Council', id => 2520 ); -$mech->create_body_ok( 2522, 'Dudley Borough Council' ); -$mech->create_body_ok( 2514, 'Birmingham City Council' ); -$mech->create_body_ok( 2546, 'Walsall Borough Council' ); -$mech->create_body_ok( 2519, 'Wolverhampton City Council' ); -$mech->create_body_ok( 2538, 'Solihull Borough Council' ); -$mech->create_body_ok( 2535, 'Sandwell Borough Council' ); - -$user->update({ from_body => $body }); - -my $date = $dt_parser->format_datetime(DateTime->now); - -my $report = FixMyStreet::DB->resultset('Problem')->find_or_create( { - postcode => 'EH1 1BB', - bodies_str => '2520', - areas => ',2520,', - service => 'Android', - category => 'Bus', - subcategory => 'Loud Music', - title => 'Loud Music', - detail => 'Loud Music', - used_map => 1, - name => 'SeeSomething Test User', - anonymous => 0, - state => 'confirmed', - confirmed => $date, - lang => 'en-gb', - cobrand => 'default', - cobrand_data => '', - send_questionnaire => 1, - latitude => '52.4081', - longitude => '-1.5106', - user_id => $user->id, -} ); - -subtest 'admin/stats' => sub { - FixMyStreet::override_config { - ALLOWED_COBRANDS => [ 'seesomething' ], - }, sub { - my $user = $mech->log_in_ok( $EMAIL ); - - $mech->get( '/admin/stats' ); - if (ok $mech->success) { - - $date =~s/ / /; - $date =~s/\+0000//; - my $xml = <<EOXML; - <tr> - <td>Android</td> - <td>Bus</td> - <td class="nowrap">Loud Music</td> - <td class="nowrap">Coventry </td> - <td class="nowrap">$date</td> - </tr> -EOXML - $mech->content_contains($xml); - } - else { - diag $mech->content; - diag $mech->status; - }; - } -}; - -$db->txn_rollback; -done_testing; |