aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/questionnaire.t
diff options
context:
space:
mode:
Diffstat (limited to 't/app/controller/questionnaire.t')
-rw-r--r--t/app/controller/questionnaire.t39
1 files changed, 27 insertions, 12 deletions
diff --git a/t/app/controller/questionnaire.t b/t/app/controller/questionnaire.t
index 3a6a3d6ad..6ee7ba58f 100644
--- a/t/app/controller/questionnaire.t
+++ b/t/app/controller/questionnaire.t
@@ -30,7 +30,7 @@ my $sent_time = $sent->ymd . ' ' . $sent->hms;
my $report = FixMyStreet::App->model('DB::Problem')->find_or_create(
{
postcode => 'EH1 1BB',
- council => '2651',
+ bodies_str => '2651',
areas => ',11808,135007,14419,134935,2651,20728,',
category => 'Street lighting',
title => 'Testing',
@@ -329,6 +329,10 @@ for my $test (
fixed => 0
},
{
+ state => 'action scheduled',
+ fixed => 0
+ },
+ {
state => 'in progress',
fixed => 0
},
@@ -337,6 +341,18 @@ for my $test (
fixed => 0
},
{
+ state => 'duplicate',
+ fixed => 0
+ },
+ {
+ state => 'not responsible',
+ fixed => 0
+ },
+ {
+ state => 'unable to fix',
+ fixed => 0
+ },
+ {
state => 'closed',
fixed => 0
},
@@ -367,10 +383,9 @@ for my $test (
};
}
-SKIP: {
- skip( "Need 'emptyhomes' in ALLOWED_COBRANDS config", 18 )
- unless FixMyStreet::Cobrand->exists('emptyhomes');
-
+FixMyStreet::override_config {
+ ALLOWED_COBRANDS => [ 'emptyhomes', 'fixmystreet' ],
+}, sub {
# EHA extra checking
ok $mech->host("reportemptyhomes.com"), 'change host to reportemptyhomes';
@@ -386,7 +401,8 @@ SKIP: {
ok $email, "got an email";
$mech->clear_emails_ok;
- like $email->body, qr/fill in this short questionnaire/i, "got questionnaire email";
+ (my $body = $email->body) =~ s/\s+/ /g;
+ like $body, qr/fill in this short questionnaire/i, "got questionnaire email";
($token) = $email->body =~ m{http://.*?/Q/(\S+)};
ok $token, "extracted questionnaire token '$token'";
@@ -420,12 +436,11 @@ SKIP: {
ok $questionnaire, 'found questionnaire';
$questionnaire2->delete;
-}
-
-SKIP: {
- skip( "Need 'fiksgatami' in ALLOWED_COBRANDS config", 5 )
- unless FixMyStreet::Cobrand->exists('fiksgatami');
+};
+FixMyStreet::override_config {
+ ALLOWED_COBRANDS => [ 'fiksgatami' ],
+}, sub {
# I18N Unicode extra testing using FiksGataMi
$report->send_questionnaire( 1 );
$report->cobrand( 'fiksgatami' );
@@ -439,7 +454,7 @@ SKIP: {
like $email->body, qr/Testing =96 Detail/, 'email contains encoded character from user';
like $email->body, qr/sak p=E5 FiksGataMi/, 'email contains encoded character from template';
is $email->header('Content-Type'), 'text/plain; charset="windows-1252"', 'email is in right encoding';
-}
+};
$mech->delete_user('test@example.com');
done_testing();