aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-05-05 12:22:34 +0100
committerMatthew Somerville <matthew@mysociety.org>2020-05-05 12:22:34 +0100
commit6b081480fa0e21cd85745ac8a1eb3c3e0a23b13d (patch)
tree7701c9f4e2942d2fae77d0c4878894089666119f
parent461d261919e3b7dca777d05449c9577c86dbf500 (diff)
parent5dac64b6b448f3ce34ce4392b0efb34d49b2011f (diff)
Merge branch 'fix-oxfordshire-test'
-rw-r--r--t/cobrand/oxfordshire.t37
-rw-r--r--t/open311/getservicerequestupdates.t2
2 files changed, 14 insertions, 25 deletions
diff --git a/t/cobrand/oxfordshire.t b/t/cobrand/oxfordshire.t
index 1d59909b9..65c6a3864 100644
--- a/t/cobrand/oxfordshire.t
+++ b/t/cobrand/oxfordshire.t
@@ -31,7 +31,7 @@ subtest 'check /around?ajax defaults to open reports only' => sub {
}
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ { 'oxfordshire' => '.' } ],
+ ALLOWED_COBRANDS => 'oxfordshire',
}, sub {
my $json = $mech->get_ok_json( '/around?ajax=1&status=all&bbox=' . $bbox );
my $pins = $json->{pins};
@@ -47,13 +47,14 @@ subtest 'check /around?ajax defaults to open reports only' => sub {
}
};
-my @problems = FixMyStreet::DB->resultset('Problem')->search({}, { rows => 3 })->all;
+my @problems = FixMyStreet::DB->resultset('Problem')->search({}, { rows => 3, order_by => 'id' })->all;
-subtest 'can use customer reference to search for reports' => sub {
- FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'oxfordshire' ],
- MAPIT_URL => 'http://mapit.uk/',
- }, sub {
+FixMyStreet::override_config {
+ ALLOWED_COBRANDS => 'oxfordshire',
+ MAPIT_URL => 'http://mapit.uk/',
+}, sub {
+
+ subtest 'can use customer reference to search for reports' => sub {
my $problem = $problems[0];
$problem->set_extra_metadata( customer_reference => 'ENQ12456' );
$problem->update;
@@ -61,16 +62,11 @@ subtest 'can use customer reference to search for reports' => sub {
$mech->get_ok('/around?pc=ENQ12456');
is $mech->uri->path, '/report/' . $problem->id, 'redirects to report';
};
-};
-my $user = $mech->create_user_ok( 'user@example.com', name => 'Test User' );
-my $user2 = $mech->create_user_ok( 'user2@example.com', name => 'Test User2' );
+ subtest 'check unable to fix label' => sub {
+ my $user = $mech->create_user_ok( 'user@example.com', name => 'Test User' );
+ my $user2 = $mech->create_user_ok( 'user2@example.com', name => 'Test User2' );
-subtest 'check unable to fix label' => sub {
- FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'oxfordshire' ],
- MAPIT_URL => 'http://mapit.uk/',
- }, sub {
my $problem = $problems[0];
$problem->state( 'unable to fix' );
$problem->update;
@@ -104,13 +100,8 @@ subtest 'check unable to fix label' => sub {
my $body = $mech->get_text_body_from_email($email);
like $body, qr/Investigation complete/, 'state correct in email';
};
-};
-subtest 'extra CSV columns are present' => sub {
- FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'oxfordshire' ],
- MAPIT_URL => 'http://mapit.uk/',
- }, sub {
+ subtest 'extra CSV columns are present' => sub {
$problems[1]->update({ external_id => $problems[1]->id });
$problems[2]->update({ external_id => "123098123" });
@@ -139,6 +130,4 @@ subtest 'extra CSV columns are present' => sub {
};
};
-END {
- done_testing();
-}
+done_testing();
diff --git a/t/open311/getservicerequestupdates.t b/t/open311/getservicerequestupdates.t
index 35be0f7b5..4651c38b2 100644
--- a/t/open311/getservicerequestupdates.t
+++ b/t/open311/getservicerequestupdates.t
@@ -1057,7 +1057,7 @@ for my $test (
$problem->discard_changes;
is $problem->comments->count, 2, 'two comment after fetching updates';
- my @comments = $problem->comments;
+ my @comments = $problem->comments->search(undef, { order_by => 'confirmed' });
is $comments[0]->text, "Thank you for your report. We will provide an update within 48 hours.", "correct external status code on first comment";
is $comments[1]->text, "Thank you for your report. We will provide an update within 24 hours.", "correct external status code on second comment";