diff options
author | Matthew Somerville <matthew@mysociety.org> | 2013-02-01 18:56:49 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2013-02-04 06:53:31 +0000 |
commit | 7e27a1d6a528bf8a10b7186a3d01ce801ccc1cd8 (patch) | |
tree | 8c68fad73ccb1b3835512cc6b51ca36f3d22b945 /t | |
parent | c20fb67a81c19b1a658bf0f8dabce8b39ac5b2f6 (diff) |
Make sure updates are fetched in known order for the test.
Diffstat (limited to 't')
-rw-r--r-- | t/app/controller/report_updates.t | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t index 2765ed246..cdebee35d 100644 --- a/t/app/controller/report_updates.t +++ b/t/app/controller/report_updates.t @@ -711,12 +711,10 @@ subtest "check comment with no status change has not status in meta" => sub { my @updates = $report->comments->all; is scalar @updates, 2, 'correct number of updates'; - warn $updates[0]->problem_state; - warn $updates[1]->problem_state; my $update = pop @updates; is $report->state, 'fixed - council', 'correct report state'; - is $update->problem_state, 'fixed - council', 'corect update state'; + is $update->problem_state, 'fixed - council', 'correct update state'; my $update_meta = $mech->extract_update_metas; unlike $update_meta->[1], qr/marked as/, 'update meta does not include state change'; @@ -740,13 +738,14 @@ subtest "check comment with no status change has not status in meta" => sub { ); $report->discard_changes; - @updates = $report->comments->all; + @updates = $report->comments->search(undef, { order_by => 'created' })->all;; + is scalar @updates, 3, 'correct number of updates'; $update = pop @updates; is $report->state, 'investigating', 'correct report state'; - is $update->problem_state, 'investigating', 'corect update state'; + is $update->problem_state, 'investigating', 'correct update state'; $update_meta = $mech->extract_update_metas; like $update_meta->[0], qr/marked as fixed/, 'first update meta says fixed'; unlike $update_meta->[1], qr/marked as/, 'second update meta does not include state change'; @@ -769,7 +768,7 @@ subtest "check comment with no status change has not status in meta" => sub { $mech->get_ok("/report/$report_id"); $report->discard_changes; - @updates = $report->comments->all; + @updates = $report->comments->search(undef, { order_by => 'created' })->all;; is scalar @updates, 4, 'correct number of updates'; $update = pop @updates; |