diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2014-03-24 11:59:40 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2014-04-07 17:49:58 +0100 |
commit | b0170c4be0c2c3befcbe0159d4e218db5e0e37a8 (patch) | |
tree | 8f10f2a215fe1a6e7548e20ed535ce06339279a7 /t/open311/getupdates.t | |
parent | 8f8d5e017e34a0b68a4b9c5c6958c827dcb6a172 (diff) |
Update old-style open311 script to use bodies.
Add some comments to the top of the open311 bin scripts.
Diffstat (limited to 't/open311/getupdates.t')
-rw-r--r-- | t/open311/getupdates.t | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/t/open311/getupdates.t b/t/open311/getupdates.t index 4376e2f4b..7dc7ff164 100644 --- a/t/open311/getupdates.t +++ b/t/open311/getupdates.t @@ -15,6 +15,9 @@ my $user = FixMyStreet::App->model('DB::User')->find_or_create( } ); +my $body = FixMyStreet::App->model('DB::Body')->new( { + name => 'Test Body', +} ); my $updates = Open311::GetUpdates->new( system_user => $user ); ok $updates, 'created object'; @@ -99,7 +102,7 @@ for my $test ( my $o = Open311->new( jurisdiction => 'mysociety', endpoint => 'http://example.com', test_mode => 1, test_get_returns => { 'requests.xml' => $local_requests_xml } ); - ok $updates->update_reports( [ 638344 ], $o, { name => 'Test Council' } ); + ok $updates->update_reports( [ 638344 ], $o, $body ); is $o->test_uri_used, 'http://example.com/requests.xml?jurisdiction_id=mysociety&service_request_id=638344', 'get url'; is $problem->comments->count, $test->{comment_count}, 'added a comment'; @@ -174,7 +177,7 @@ subtest 'update with two requests' => sub { my $o = Open311->new( jurisdiction => 'mysociety', endpoint => 'http://example.com', test_mode => 1, test_get_returns => { 'requests.xml' => $local_requests_xml } ); - ok $updates->update_reports( [ 638344,638345 ], $o, { name => 'Test Council' } ); + ok $updates->update_reports( [ 638344,638345 ], $o, $body ); is $o->test_uri_used, 'http://example.com/requests.xml?jurisdiction_id=mysociety&service_request_id=638344%2C638345', 'get url'; is $problem->comments->count, 1, 'added a comment to first problem'; @@ -228,7 +231,7 @@ subtest 'test translation of auto-added comment from old-style Open311 update' = FixMyStreet::override_config { ALLOWED_COBRANDS => [ 'fixamingata' ], }, sub { - ok $updates->update_reports( [ 638346 ], $o, { name => 'Test Council' } ); + ok $updates->update_reports( [ 638346 ], $o, $body ); }; is $o->test_uri_used, 'http://example.com/requests.xml?jurisdiction_id=mysociety&service_request_id=638346', 'get url'; |