aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-external/modules.txt1
-rw-r--r--perl-external/urls.txt2
-rw-r--r--perllib/FixMyStreet/App/Controller/Photo.pm9
-rw-r--r--perllib/FixMyStreet/DB/Result/Comment.pm13
-rw-r--r--perllib/FixMyStreet/TestMech.pm11
5 files changed, 31 insertions, 5 deletions
diff --git a/perl-external/modules.txt b/perl-external/modules.txt
index 156fe294e..3e00b987a 100644
--- a/perl-external/modules.txt
+++ b/perl-external/modules.txt
@@ -20,6 +20,7 @@ DBIx::Class
DBIx::Class::FilterColumn
DBIx::Class::Schema::Loader
DBIx::Class::Storage::DBI
+DateTime::Format::HTTP
Email::Address
Email::Send
Email::Simple
diff --git a/perl-external/urls.txt b/perl-external/urls.txt
index cec9e556b..777afaa6b 100644
--- a/perl-external/urls.txt
+++ b/perl-external/urls.txt
@@ -61,6 +61,7 @@ http://search.cpan.org/CPAN/authors/id/C/CH/CHORNY/Hook-LexWrap-0.24.tar.gz
http://search.cpan.org/CPAN/authors/id/C/CH/CHORNY/Test-Warn-0.23.tar.gz
http://search.cpan.org/CPAN/authors/id/C/CH/CHORNY/Tie-IxHash-1.22.tar.gz
http://search.cpan.org/CPAN/authors/id/C/CI/CINE/Lingua-Stem-Snowball-Da-1.01.tar.gz
+http://search.cpan.org/CPAN/authors/id/C/CK/CKRAS/DateTime-Format-HTTP-0.40.tar.gz
http://search.cpan.org/CPAN/authors/id/C/CO/COGENT/Tree-DAG_Node-1.06.tar.gz
http://search.cpan.org/CPAN/authors/id/C/CR/CRENZ/Module-Find-0.10.tar.gz
http://search.cpan.org/CPAN/authors/id/D/DA/DAGOLDEN/CPAN-Meta-2.110580.tar.gz
@@ -147,6 +148,7 @@ http://search.cpan.org/CPAN/authors/id/M/MH/MHX/Devel-PPPort-3.19.tar.gz
http://search.cpan.org/CPAN/authors/id/M/MI/MIROD/HTML-TreeBuilder-XPath-0.12.tar.gz
http://search.cpan.org/CPAN/authors/id/M/MI/MIROD/XML-XPathEngine-0.12.tar.gz
http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.4004.tar.gz
+http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.4007.tar.gz
http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/HTML-Selector-XPath-0.07.tar.gz
http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/Template-Plugin-Comma-0.04.tar.gz
http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/Web-Scraper-0.34.tar.gz
diff --git a/perllib/FixMyStreet/App/Controller/Photo.pm b/perllib/FixMyStreet/App/Controller/Photo.pm
index 64a4aef93..3dc1275f0 100644
--- a/perllib/FixMyStreet/App/Controller/Photo.pm
+++ b/perllib/FixMyStreet/App/Controller/Photo.pm
@@ -4,6 +4,8 @@ use namespace::autoclean;
BEGIN {extends 'Catalyst::Controller'; }
+use DateTime::Format::HTTP;
+
=head1 NAME
FixMyStreet::App::Controller::Photo - Catalyst Controller
@@ -48,7 +50,12 @@ sub index :Path :Args(0) {
$photo = _resize( $photo, '195x' );
}
- print $photo;
+ my $dt = DateTime->now();
+ $dt->set_year( $dt->year + 1 );
+
+ $c->res->content_type( 'image/jpeg' );
+ $c->res->header( 'expires', DateTime::Format::HTTP->format_datetime( $dt ) );
+ $c->res->body( $photo );
}
sub _resize {
diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm
index 6eefb30b2..7259087be 100644
--- a/perllib/FixMyStreet/DB/Result/Comment.pm
+++ b/perllib/FixMyStreet/DB/Result/Comment.pm
@@ -84,4 +84,17 @@ sub check_for_errors {
return \%errors;
}
+
+=head2 confirm
+
+Set state of comment to confirmed
+
+=cut
+
+sub confirm {
+ my $self = shift;
+
+ $self->state( 'confirmed' );
+ $self->confirmed( \'ms_current_timestamp()' );
+}
1;
diff --git a/perllib/FixMyStreet/TestMech.pm b/perllib/FixMyStreet/TestMech.pm
index b558d0dda..35f934299 100644
--- a/perllib/FixMyStreet/TestMech.pm
+++ b/perllib/FixMyStreet/TestMech.pm
@@ -128,10 +128,13 @@ sub delete_user {
}
$mech->log_out_ok;
- ok( $_->delete, "delete comment" . $_->text ) #
- for $user->comments;
- ok( $_->delete, "delete problem " . $_->title ) #
- for $user->problems;
+ for my $p ( $user->problems ) {
+ ok( $_->delete, "delete comment " . $_->text )
+ for $p->comments;
+ ok( $p->delete, "delete problem " . $p->title );
+ }
+ ok( $_->delete, "delete comment " . $_->text )
+ for $user->comments;
ok( $_->delete, "delete alert " . $_->alert_type )
for $user->alerts;
ok $user->delete, "delete test user " . $user->email;