aboutsummaryrefslogtreecommitdiffstats
path: root/t/Mock
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2016-01-27 11:38:59 +0000
committerMatthew Somerville <matthew@mysociety.org>2016-01-29 15:08:18 +0000
commitb4e69645bd2ff24fb603bf7461e2c80b316eaeaa (patch)
tree0b25ff4d36bfe3b9685c8d3818760ab3e41f2950 /t/Mock
parent2679b30e530861ba7c2bef6f36a60242872bd6a7 (diff)
Spot media_url in Open311 GetServiceRequestUpdate.
Fixes #1315.
Diffstat (limited to 't/Mock')
-rw-r--r--t/Mock/Static.pm18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/Mock/Static.pm b/t/Mock/Static.pm
new file mode 100644
index 000000000..260c181cd
--- /dev/null
+++ b/t/Mock/Static.pm
@@ -0,0 +1,18 @@
+package t::Mock::Static;
+
+use Path::Tiny;
+use Web::Simple;
+
+my $sample_file = path(__FILE__)->parent->parent->child("app/controller/sample.jpg");
+my $sample_photo = $sample_file->slurp_raw;
+
+sub dispatch_request {
+ my $self = shift;
+
+ sub (GET + /image.jpeg) {
+ my ($self) = @_;
+ return [ 200, [ 'Content-Type' => 'image/jpeg' ], [ $sample_photo ] ];
+ },
+}
+
+__PACKAGE__->run_if_script;