diff options
author | Struan Donald <struan@exo.org.uk> | 2011-09-05 16:59:05 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-09-05 16:59:05 +0100 |
commit | eb823376088f47abf23050a0193225a45b51d6d3 (patch) | |
tree | a6eb5fc8cf694a7dd70d7d1a957d65ec09a6c60a /t/app/controller/questionnaire.t | |
parent | bc39723b98a0bb07cc8d57e99489e3a014d857ef (diff) | |
parent | 7fc1083eb431312a59758c473e8ff52ceb8585ef (diff) |
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet into js-validation
Conflicts:
templates/web/default/common_header_tags.html
Diffstat (limited to 't/app/controller/questionnaire.t')
-rw-r--r-- | t/app/controller/questionnaire.t | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/t/app/controller/questionnaire.t b/t/app/controller/questionnaire.t index af3b373ac..a013569ee 100644 --- a/t/app/controller/questionnaire.t +++ b/t/app/controller/questionnaire.t @@ -1,6 +1,7 @@ use strict; use warnings; use Test::More; +use DateTime; use FixMyStreet::TestMech; use FixMyStreet::App::Controller::Questionnaire; @@ -15,7 +16,10 @@ my $user = ->find_or_create( { email => 'test@example.com', name => 'Test User' } ); ok $user, "created test user"; -my $report_time = '2011-03-01 12:00:00'; +my $dt = DateTime->now()->subtract( weeks => 5 ); +my $report_time = $dt->ymd . ' ' . $dt->hms; +my $sent = $dt->add( minutes => 5 ); +my $sent_time = $sent->ymd . ' ' . $sent->hms; my $report = FixMyStreet::App->model('DB::Problem')->find_or_create( { @@ -31,7 +35,7 @@ my $report = FixMyStreet::App->model('DB::Problem')->find_or_create( state => 'confirmed', confirmed => $report_time, lastupdate => $report_time, - whensent => '2011-03-01 12:05:00', + whensent => $sent_time, lang => 'en-gb', service => '', cobrand => 'default', @@ -334,10 +338,11 @@ $mech->get_ok("/Q/" . $token); $mech->content_contains( 'should have reported what they have done' ); # Test already answered the ever reported question, so not shown again +$dt = $dt->add( weeks => 4 ); my $questionnaire2 = FixMyStreet::App->model('DB::Questionnaire')->find_or_create( { problem_id => $report->id, - whensent => '2011-03-28 12:00:00', + whensent => $dt->ymd . ' ' . $dt->hms, ever_reported => 1, } ); |