aboutsummaryrefslogtreecommitdiffstats
path: root/t/app
diff options
context:
space:
mode:
Diffstat (limited to 't/app')
-rw-r--r--t/app/controller/about.t9
-rw-r--r--t/app/controller/admin.t4
-rw-r--r--t/app/controller/admin_permissions.t4
-rw-r--r--t/app/controller/alert.t3
-rw-r--r--t/app/controller/alert_new.t4
-rw-r--r--t/app/controller/around.t4
-rw-r--r--t/app/controller/auth.t4
-rw-r--r--t/app/controller/auth_social.t3
-rw-r--r--t/app/controller/contact.t4
-rw-r--r--t/app/controller/dashboard.t3
-rw-r--r--t/app/controller/index.t4
-rw-r--r--t/app/controller/json.t5
-rw-r--r--t/app/controller/moderate.t5
-rw-r--r--t/app/controller/my.t5
-rw-r--r--t/app/controller/my_planned.t5
-rw-r--r--t/app/controller/open311.t5
-rw-r--r--t/app/controller/photo.t7
-rw-r--r--t/app/controller/questionnaire.t3
-rw-r--r--t/app/controller/report_as_other.t4
-rw-r--r--t/app/controller/report_display.t4
-rw-r--r--t/app/controller/report_import.t4
-rw-r--r--t/app/controller/report_inspect.t4
-rw-r--r--t/app/controller/report_interest_count.t5
-rw-r--r--t/app/controller/report_new.t5
-rw-r--r--t/app/controller/report_new_mobile.t1
-rw-r--r--t/app/controller/report_new_open311.t4
-rw-r--r--t/app/controller/report_updates.t4
-rw-r--r--t/app/controller/reports.t3
-rw-r--r--t/app/controller/rss.t4
-rw-r--r--t/app/controller/token.t5
-rw-r--r--t/app/helpers/send_email.t10
-rw-r--r--t/app/load_general_config.t4
-rw-r--r--t/app/model/alert_type.t3
-rw-r--r--t/app/model/defecttype.t4
-rw-r--r--t/app/model/extra.t1
-rw-r--r--t/app/model/moderation.t1
-rw-r--r--t/app/model/problem.t5
-rw-r--r--t/app/model/questionnaire.t5
-rw-r--r--t/app/model/user.t5
-rw-r--r--t/app/model/user_planned_report.t5
-rw-r--r--t/app/script/archive_old_enquiries.t3
-rw-r--r--t/app/sendreport/email.t5
-rw-r--r--t/app/sendreport/inspection_required.t13
43 files changed, 8 insertions, 184 deletions
diff --git a/t/app/controller/about.t b/t/app/controller/about.t
index cec50abfa..8f3f25e27 100644
--- a/t/app/controller/about.t
+++ b/t/app/controller/about.t
@@ -1,11 +1,6 @@
-use utf8;
-use strict;
-use warnings;
+use FixMyStreet::TestMech;
-use Test::More;
-use Test::WWW::Mechanize::Catalyst 'FixMyStreet::App';
-
-ok( my $mech = Test::WWW::Mechanize::Catalyst->new, 'Created mech object' );
+ok( my $mech = FixMyStreet::TestMech->new, 'Created mech object' );
# check that we can get the page
$mech->get_ok('/faq');
diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t
index 5f8abe5a6..48a5edc44 100644
--- a/t/app/controller/admin.t
+++ b/t/app/controller/admin.t
@@ -1,7 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
-
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
diff --git a/t/app/controller/admin_permissions.t b/t/app/controller/admin_permissions.t
index dd256173d..c79087639 100644
--- a/t/app/controller/admin_permissions.t
+++ b/t/app/controller/admin_permissions.t
@@ -1,7 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
-
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
diff --git a/t/app/controller/alert.t b/t/app/controller/alert.t
index cb5949b8f..3ae71b7c1 100644
--- a/t/app/controller/alert.t
+++ b/t/app/controller/alert.t
@@ -1,6 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
use LWP::Protocol::PSGI;
use FixMyStreet::TestMech;
diff --git a/t/app/controller/alert_new.t b/t/app/controller/alert_new.t
index ea38f7c25..f7d35f9a0 100644
--- a/t/app/controller/alert_new.t
+++ b/t/app/controller/alert_new.t
@@ -1,7 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
-
use FixMyStreet::TestMech;
use FixMyStreet::App;
diff --git a/t/app/controller/around.t b/t/app/controller/around.t
index c8aca04aa..fbb4e76cd 100644
--- a/t/app/controller/around.t
+++ b/t/app/controller/around.t
@@ -1,7 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
-
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
diff --git a/t/app/controller/auth.t b/t/app/controller/auth.t
index 3a11cfc4a..d1e313df2 100644
--- a/t/app/controller/auth.t
+++ b/t/app/controller/auth.t
@@ -1,7 +1,3 @@
-use strict;
-use warnings;
-
-use Test::More;
use Test::MockModule;
use FixMyStreet::TestMech;
diff --git a/t/app/controller/auth_social.t b/t/app/controller/auth_social.t
index 09fdf22d3..7a82fc813 100644
--- a/t/app/controller/auth_social.t
+++ b/t/app/controller/auth_social.t
@@ -1,6 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
use Test::MockModule;
use LWP::Protocol::PSGI;
use LWP::Simple;
diff --git a/t/app/controller/contact.t b/t/app/controller/contact.t
index 7c2769b9c..d98d81868 100644
--- a/t/app/controller/contact.t
+++ b/t/app/controller/contact.t
@@ -1,7 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
-
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
diff --git a/t/app/controller/dashboard.t b/t/app/controller/dashboard.t
index c83902c48..9713d2d2c 100644
--- a/t/app/controller/dashboard.t
+++ b/t/app/controller/dashboard.t
@@ -1,6 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
use Test::MockTime ':all';
use FixMyStreet::TestMech;
diff --git a/t/app/controller/index.t b/t/app/controller/index.t
index 6b28a03d2..91d0a8fcb 100644
--- a/t/app/controller/index.t
+++ b/t/app/controller/index.t
@@ -1,7 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
-
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
diff --git a/t/app/controller/json.t b/t/app/controller/json.t
index b2cea674f..f7410dbd0 100644
--- a/t/app/controller/json.t
+++ b/t/app/controller/json.t
@@ -1,8 +1,3 @@
-use strict;
-use warnings;
-
-use Test::More;
-
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
diff --git a/t/app/controller/moderate.t b/t/app/controller/moderate.t
index 10287ab22..a4a7f3cb6 100644
--- a/t/app/controller/moderate.t
+++ b/t/app/controller/moderate.t
@@ -1,8 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
-use utf8;
-
use FixMyStreet::TestMech;
use FixMyStreet::App;
use Data::Dumper;
diff --git a/t/app/controller/my.t b/t/app/controller/my.t
index 00070ed81..8803e7877 100644
--- a/t/app/controller/my.t
+++ b/t/app/controller/my.t
@@ -1,8 +1,3 @@
-use strict;
-use warnings;
-
-use Test::More;
-
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
diff --git a/t/app/controller/my_planned.t b/t/app/controller/my_planned.t
index 79ed0e72c..79d9e9e72 100644
--- a/t/app/controller/my_planned.t
+++ b/t/app/controller/my_planned.t
@@ -1,8 +1,3 @@
-use strict;
-use warnings;
-
-use Test::More;
-
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
diff --git a/t/app/controller/open311.t b/t/app/controller/open311.t
index 9b0a6f8af..29cd38129 100644
--- a/t/app/controller/open311.t
+++ b/t/app/controller/open311.t
@@ -1,8 +1,3 @@
-use strict;
-use warnings;
-
-use Test::More;
-
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
diff --git a/t/app/controller/photo.t b/t/app/controller/photo.t
index ad857b5e3..dbbc697d7 100644
--- a/t/app/controller/photo.t
+++ b/t/app/controller/photo.t
@@ -1,10 +1,3 @@
-use strict;
-use utf8; # sign in error message has – in it
-use warnings;
-use feature 'say';
-use Test::More;
-use utf8;
-
use FixMyStreet::TestMech;
use FixMyStreet::App;
use Web::Scraper;
diff --git a/t/app/controller/questionnaire.t b/t/app/controller/questionnaire.t
index f42908a3e..b046cec9b 100644
--- a/t/app/controller/questionnaire.t
+++ b/t/app/controller/questionnaire.t
@@ -1,6 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
use DateTime;
use FixMyStreet::TestMech;
diff --git a/t/app/controller/report_as_other.t b/t/app/controller/report_as_other.t
index 551a59481..96c6df239 100644
--- a/t/app/controller/report_as_other.t
+++ b/t/app/controller/report_as_other.t
@@ -1,7 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
-
use FixMyStreet::TestMech;
use FixMyStreet::App;
diff --git a/t/app/controller/report_display.t b/t/app/controller/report_display.t
index b35a4a026..81b0ffb86 100644
--- a/t/app/controller/report_display.t
+++ b/t/app/controller/report_display.t
@@ -1,7 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
-
use FixMyStreet::TestMech;
use Web::Scraper;
use Path::Class;
diff --git a/t/app/controller/report_import.t b/t/app/controller/report_import.t
index b956b61ae..25875b38a 100644
--- a/t/app/controller/report_import.t
+++ b/t/app/controller/report_import.t
@@ -1,7 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
-
use FixMyStreet::TestMech;
use FixMyStreet::App;
use Web::Scraper;
diff --git a/t/app/controller/report_inspect.t b/t/app/controller/report_inspect.t
index e1723b0cd..8b375bfe4 100644
--- a/t/app/controller/report_inspect.t
+++ b/t/app/controller/report_inspect.t
@@ -1,7 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
-
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
diff --git a/t/app/controller/report_interest_count.t b/t/app/controller/report_interest_count.t
index 3cb80ea5f..bd9660dea 100644
--- a/t/app/controller/report_interest_count.t
+++ b/t/app/controller/report_interest_count.t
@@ -1,6 +1,3 @@
-use strict;
-use warnings;
-
package FixMyStreet::Cobrand::Tester;
use parent 'FixMyStreet::Cobrand::Default';
@@ -11,8 +8,6 @@ sub can_support_problems {
package main;
-use Test::More;
-
use FixMyStreet::TestMech;
use Web::Scraper;
use Path::Class;
diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t
index 33324d210..36400ae81 100644
--- a/t/app/controller/report_new.t
+++ b/t/app/controller/report_new.t
@@ -1,8 +1,3 @@
-use strict;
-use utf8; # sign in error message has – in it
-use warnings;
-use Test::More;
-
use FixMyStreet::TestMech;
use FixMyStreet::App;
use Web::Scraper;
diff --git a/t/app/controller/report_new_mobile.t b/t/app/controller/report_new_mobile.t
index 3dfb99b2f..7f71a2786 100644
--- a/t/app/controller/report_new_mobile.t
+++ b/t/app/controller/report_new_mobile.t
@@ -1,4 +1,3 @@
-use Test::More;
use FixMyStreet::TestMech;
use LWP::Protocol::PSGI;
use t::Mock::MapItZurich;
diff --git a/t/app/controller/report_new_open311.t b/t/app/controller/report_new_open311.t
index e3a464f88..4c3fefc56 100644
--- a/t/app/controller/report_new_open311.t
+++ b/t/app/controller/report_new_open311.t
@@ -1,7 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
-
use FixMyStreet::TestMech;
use FixMyStreet::App;
use Web::Scraper;
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t
index a1e26476f..941989f24 100644
--- a/t/app/controller/report_updates.t
+++ b/t/app/controller/report_updates.t
@@ -1,7 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
-
use FixMyStreet::TestMech;
use Web::Scraper;
use Path::Class;
diff --git a/t/app/controller/reports.t b/t/app/controller/reports.t
index 56b4cce8c..8e226de8c 100644
--- a/t/app/controller/reports.t
+++ b/t/app/controller/reports.t
@@ -1,6 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
use FixMyStreet::TestMech;
use mySociety::MaPit;
use FixMyStreet::App;
diff --git a/t/app/controller/rss.t b/t/app/controller/rss.t
index bec504760..2258c9f5b 100644
--- a/t/app/controller/rss.t
+++ b/t/app/controller/rss.t
@@ -1,7 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
-
use FixMyStreet::TestMech;
use FixMyStreet::App;
diff --git a/t/app/controller/token.t b/t/app/controller/token.t
index ac88f4f7a..858838865 100644
--- a/t/app/controller/token.t
+++ b/t/app/controller/token.t
@@ -1,8 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
-use utf8;
-
use FixMyStreet::TestMech;
use FixMyStreet::App;
diff --git a/t/app/helpers/send_email.t b/t/app/helpers/send_email.t
index 66b771292..a692fb6bc 100644
--- a/t/app/helpers/send_email.t
+++ b/t/app/helpers/send_email.t
@@ -1,20 +1,10 @@
-use strict;
-use warnings;
-use utf8;
-
package FixMyStreet::Cobrand::Tester;
use parent 'FixMyStreet::Cobrand::Default';
sub path_to_email_templates { [ FixMyStreet->path_to( 't', 'app', 'helpers', 'emails') ] }
package main;
-BEGIN {
- use FixMyStreet;
- FixMyStreet->test_mode(1);
-}
-
use Email::MIME;
-use Test::More;
use Test::LongString;
use Catalyst::Test 'FixMyStreet::App';
diff --git a/t/app/load_general_config.t b/t/app/load_general_config.t
index 16ca2fc54..aace85c86 100644
--- a/t/app/load_general_config.t
+++ b/t/app/load_general_config.t
@@ -3,8 +3,8 @@ use warnings;
use Test::More tests => 2;
-use_ok 'FixMyStreet::App';
+use_ok 'FixMyStreet';
-is FixMyStreet::App->config->{GAZE_URL},
+is FixMyStreet->config('GAZE_URL'),
'https://gaze.mysociety.org/gaze',
"check that known config param is loaded";
diff --git a/t/app/model/alert_type.t b/t/app/model/alert_type.t
index 5e4fcec0a..2e1298134 100644
--- a/t/app/model/alert_type.t
+++ b/t/app/model/alert_type.t
@@ -1,6 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
use FixMyStreet::TestMech;
mySociety::Locale::gettext_domain( 'FixMyStreet' );
diff --git a/t/app/model/defecttype.t b/t/app/model/defecttype.t
index 0f66ac684..6a03deded 100644
--- a/t/app/model/defecttype.t
+++ b/t/app/model/defecttype.t
@@ -1,7 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
-
use FixMyStreet::App;
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
diff --git a/t/app/model/extra.t b/t/app/model/extra.t
index 3b46ce128..2d5c3d5e0 100644
--- a/t/app/model/extra.t
+++ b/t/app/model/extra.t
@@ -4,7 +4,6 @@ use Test::More;
use utf8;
use FixMyStreet::DB;
-use Data::Dumper;
use DateTime;
my $db = FixMyStreet::DB->connect;
diff --git a/t/app/model/moderation.t b/t/app/model/moderation.t
index 8fa333db4..4dbda3f6c 100644
--- a/t/app/model/moderation.t
+++ b/t/app/model/moderation.t
@@ -5,7 +5,6 @@ use Test::Exception;
use utf8;
use FixMyStreet::DB;
-use Data::Dumper;
use DateTime;
my $dt = DateTime->now;
diff --git a/t/app/model/problem.t b/t/app/model/problem.t
index 47f654236..d95aec98d 100644
--- a/t/app/model/problem.t
+++ b/t/app/model/problem.t
@@ -1,8 +1,3 @@
-use strict;
-use warnings;
-
-use Test::More;
-
use FixMyStreet::TestMech;
use FixMyStreet;
use FixMyStreet::App;
diff --git a/t/app/model/questionnaire.t b/t/app/model/questionnaire.t
index 945a64633..9685c5345 100644
--- a/t/app/model/questionnaire.t
+++ b/t/app/model/questionnaire.t
@@ -1,8 +1,3 @@
-use strict;
-use warnings;
-
-use Test::More;
-
use FixMyStreet;
use FixMyStreet::TestMech;
diff --git a/t/app/model/user.t b/t/app/model/user.t
index dd8b8ca5d..76d395fdc 100644
--- a/t/app/model/user.t
+++ b/t/app/model/user.t
@@ -1,8 +1,3 @@
-use strict;
-use warnings;
-
-use Test::More;
-
use FixMyStreet::TestMech;
use FixMyStreet::DB;
diff --git a/t/app/model/user_planned_report.t b/t/app/model/user_planned_report.t
index 95a76615e..3473e1bbd 100644
--- a/t/app/model/user_planned_report.t
+++ b/t/app/model/user_planned_report.t
@@ -1,8 +1,3 @@
-use strict;
-use warnings;
-
-use Test::More;
-
use FixMyStreet::TestMech;
use FixMyStreet::DB;
diff --git a/t/app/script/archive_old_enquiries.t b/t/app/script/archive_old_enquiries.t
index e87d6a0f8..589aeceda 100644
--- a/t/app/script/archive_old_enquiries.t
+++ b/t/app/script/archive_old_enquiries.t
@@ -1,6 +1,3 @@
-use strict;
-use warnings;
-use Test::More;
use FixMyStreet::TestMech;
use FixMyStreet::Script::ArchiveOldEnquiries;
diff --git a/t/app/sendreport/email.t b/t/app/sendreport/email.t
index 471145dcb..a9bc9f2b1 100644
--- a/t/app/sendreport/email.t
+++ b/t/app/sendreport/email.t
@@ -1,8 +1,3 @@
-use strict;
-use warnings;
-
-use Test::More;
-
use FixMyStreet;
use FixMyStreet::DB;
use FixMyStreet::SendReport::Email;
diff --git a/t/app/sendreport/inspection_required.t b/t/app/sendreport/inspection_required.t
index f9d40d39f..f588e00f1 100644
--- a/t/app/sendreport/inspection_required.t
+++ b/t/app/sendreport/inspection_required.t
@@ -1,8 +1,3 @@
-use strict;
-use warnings;
-
-use Test::More;
-
use FixMyStreet;
use FixMyStreet::DB;
use FixMyStreet::TestMech;
@@ -31,13 +26,13 @@ my @reports = $mech->create_problems_for_body( 1, $body->id, 'Test', {
});
my $report = $reports[0];
-subtest 'Report isn’t sent if uninspected' => sub {
+subtest "Report isn't sent if uninspected" => sub {
$mech->clear_emails_ok;
FixMyStreet::DB->resultset('Problem')->send_reports();
$mech->email_count_is( 0 );
- is $report->whensent, undef, 'Report hasn’t been sent';
+ is $report->whensent, undef, "Report hasn't been sent";
};
subtest 'Report is sent when inspected' => sub {
@@ -72,7 +67,7 @@ subtest 'Uninspected report is sent when made by trusted user' => sub {
is $report->get_extra_metadata('inspected'), undef, 'Report not marked as inspected';
};
-subtest 'Uninspected report isn’t sent when user rep is too low' => sub {
+subtest "Uninspected report isn't sent when user rep is too low" => sub {
$mech->clear_emails_ok;
$report->whensent( undef );
$report->update;
@@ -88,7 +83,7 @@ subtest 'Uninspected report isn’t sent when user rep is too low' => sub {
$report->discard_changes;
$mech->email_count_is( 0 );
- is $report->whensent, undef, 'Report hasn’t been sent';
+ is $report->whensent, undef, "Report hasn't been sent";
};
subtest 'Uninspected report is sent when user rep is high enough' => sub {