aboutsummaryrefslogtreecommitdiffstats
path: root/t/open311.t
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-05-24 15:09:06 +0100
committerStruan Donald <struan@exo.org.uk>2012-05-24 15:09:06 +0100
commit65820a534a42852d0d9a1819649f48a54b37c22f (patch)
tree73fb2c02bdaf20d5e9053e7f6ab2f784fa4e3de8 /t/open311.t
parent47979155279b45b9bb4b12b57cde49c6bf00681f (diff)
send media_url if comment has a photo
Diffstat (limited to 't/open311.t')
-rw-r--r--t/open311.t16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/open311.t b/t/open311.t
index 60757219e..814b11f82 100644
--- a/t/open311.t
+++ b/t/open311.t
@@ -214,6 +214,22 @@ subtest 'basic request update post parameters' => sub {
is $c->param('last_name'), 'User', 'correct first name';
is $c->param('first_name'), 'Test', 'correct second name';
is $c->param('email_alerts_requested'), 'FALSE', 'email alerts flag correct';
+ is $c->param('media_url'), undef, 'no media url';
+};
+
+subtest 'check media url set' => sub {
+ $comment->photo(1);
+ $comment->cobrand('fixmystreet');
+
+ my $results = make_update_req( $comment, '<?xml version="1.0" encoding="utf-8"?><service_request_updates><request_update><update_id>248</update_id></request_update></service_request_updates>' );
+
+ is $results->{ res }, 248, 'got update id';
+
+ my $req = $o->test_req_used;
+
+ my $c = CGI::Simple->new( $results->{ req }->content );
+ my $expected_path = '/c/' . $comment->id . '.full.jpeg';
+ like $c->param('media_url'), qr/$expected_path/, 'image url included';
};
foreach my $test (