diff options
-rw-r--r-- | perllib/FixMyStreet/Cobrand/TfL.pm | 9 | ||||
-rw-r--r-- | t/app/controller/admin/templates.t | 9 | ||||
-rw-r--r-- | t/cobrand/tfl.t | 6 |
3 files changed, 16 insertions, 8 deletions
diff --git a/perllib/FixMyStreet/Cobrand/TfL.pm b/perllib/FixMyStreet/Cobrand/TfL.pm index 61ac7a8b2..1423a7c63 100644 --- a/perllib/FixMyStreet/Cobrand/TfL.pm +++ b/perllib/FixMyStreet/Cobrand/TfL.pm @@ -102,6 +102,15 @@ sub report_sent_confirmation_email { 'id' } sub report_age { '6 weeks' } +# We don't want any reports made before the go-live date visible +sub problems_restriction { + my ($self, $rs) = @_; + my $table = ref $rs eq 'FixMyStreet::DB::ResultSet::Nearby' ? 'problem' : 'me'; + return $rs->to_body($self->body)->search({ + "$table.confirmed" => { '>=', '2019-12-09 12:00' } + }); +} + sub password_expiry { return if FixMyStreet->test_mode; # uncoverable statement diff --git a/t/app/controller/admin/templates.t b/t/app/controller/admin/templates.t index ee477de20..200fbd727 100644 --- a/t/app/controller/admin/templates.t +++ b/t/app/controller/admin/templates.t @@ -35,14 +35,7 @@ my $tfltemplate = $tfl->response_templates->create({ text => "This template will only appear on the TfL cobrand.", }); -my $dt = DateTime->new( - year => 2011, - month => 04, - day => 16, - hour => 15, - minute => 47, - second => 23 -); +my $dt = DateTime->now(); my $report = FixMyStreet::DB->resultset('Problem')->find_or_create( { diff --git a/t/cobrand/tfl.t b/t/cobrand/tfl.t index 86ab5a6f3..287a8c98e 100644 --- a/t/cobrand/tfl.t +++ b/t/cobrand/tfl.t @@ -521,6 +521,12 @@ subtest 'check report age on /around' => sub { $mech->get_ok( '/around?lat=' . $report->latitude . '&lon=' . $report->longitude ); $mech->content_lacks($report->title); + + $report->update({ + confirmed => \"current_timestamp", + whensent => \"current_timestamp", + lastupdate => \"current_timestamp", + }); }; subtest 'TfL admin allows inspectors to be assigned to borough areas' => sub { |