diff options
author | Struan Donald <struan@exo.org.uk> | 2018-11-09 14:40:59 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2018-11-26 09:43:11 +0000 |
commit | 231407e1106e68abf481bb65aa82cb60564fc9d6 (patch) | |
tree | a58007b402bc3ced29e491290b01c6259c077d1d /t/open311 | |
parent | cd34f8336f9fe5b3f334d350027948dbddc04345 (diff) |
Fix getservicerequestupdates test failures
Some of these were occasional failures due to timing issues.
One was due to a hard coded body id meaning the addition of bodies in
other tests meant this was creating two bodies with the same id, which
happened to be used in a test which depended on the bodies having
different ids.
Diffstat (limited to 't/open311')
-rw-r--r-- | t/open311/getservicerequestupdates.t | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/t/open311/getservicerequestupdates.t b/t/open311/getservicerequestupdates.t index b9e29c99e..54a7f192d 100644 --- a/t/open311/getservicerequestupdates.t +++ b/t/open311/getservicerequestupdates.t @@ -29,7 +29,7 @@ my %bodies = ( comment_user_id => $user->id, blank_updates_permitted => 1, }), - 2651 => FixMyStreet::DB->resultset("Body")->new({ id => 123 }), + 2651 => FixMyStreet::DB->resultset("Body")->create({ name => 'Edinburgh' }), ); $bodies{2237}->body_areas->create({ area_id => 2237 }); @@ -59,7 +59,7 @@ UPDATED_DATETIME }; -my $dt = DateTime->now(formatter => DateTime::Format::W3CDTF->new); +my $dt = DateTime->now(formatter => DateTime::Format::W3CDTF->new)->add( minutes => -5 ); # basic xml -> perl object tests for my $test ( @@ -147,7 +147,7 @@ my $problem = $problem_rs->new( created => DateTime->now()->subtract( days => 1 ), lastupdate => DateTime->now()->subtract( days => 1 ), anonymous => 1, - external_id => time(), + external_id => int(rand(time())), bodies_str => $bodies{2482}->id, } ); @@ -464,7 +464,7 @@ my $problemOx = $problem_rs->create({ created => DateTime->now()->subtract( days => 1 ), lastupdate => DateTime->now()->subtract( days => 1 ), anonymous => 1, - external_id => time(), + external_id => int(rand(time())), bodies_str => $bodies{2237}->id, }); |