Bugzilla – Attachment 68371 Details for
Bug 18890
REST API: Fix fetching operation spec in route chain
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18890: Fix cities.t
Bug-18890-Fix-citiest.patch (text/plain), 2.01 KB, created by
Mark Tompsett
on 2017-10-23 05:52:17 UTC
(
hide
)
Description:
Bug 18890: Fix cities.t
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2017-10-23 05:52:17 UTC
Size:
2.01 KB
patch
obsolete
>From 736f4e909515e4d0e5ec91e6aba02fbd153cf7f8 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@jns.fi> >Date: Mon, 3 Jul 2017 17:48:08 +0300 >Subject: [PATCH] Bug 18890: Fix cities.t > >The update also causes some tests authorization tests to fail with HTTP 400 >response instead of the expected 401/403. It seems that the parameters were >not properly validated before and the tests were mistakenly passing. > >To test: >1. prove t/db_dependent/api/v1/cities.t > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> >--- > t/db_dependent/api/v1/cities.t | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > >diff --git a/t/db_dependent/api/v1/cities.t b/t/db_dependent/api/v1/cities.t >index aeace2f..fca3bdf 100644 >--- a/t/db_dependent/api/v1/cities.t >+++ b/t/db_dependent/api/v1/cities.t >@@ -224,9 +224,17 @@ subtest 'update() tests' => sub { > > my $city_id = $builder->build( { source => 'City' } )->{cityid}; > >+ # Full object update on PUT >+ my $city_with_updated_field = { >+ city_name => "London", >+ city_state => "City State", >+ city_zipcode => "City Zipcode", >+ city_country => "City Country" >+ }; >+ > # Unauthorized attempt to update > my $tx = $t->ua->build_tx( PUT => "/api/v1/cities/$city_id" => json => >- { city_name => 'New unauthorized name change' } ); >+ $city_with_updated_field ); > $tx->req->cookies( > { name => 'CGISESSID', value => $unauthorized_session_id } ); > $tx->req->env( { REMOTE_ADDR => $remote_address } ); >@@ -249,14 +257,6 @@ subtest 'update() tests' => sub { > [ { message => "Missing property.", path => "/body/city_zipcode" } ] > ); > >- # Full object update on PUT >- my $city_with_updated_field = { >- city_name => "London", >- city_state => "City State", >- city_zipcode => "City Zipcode", >- city_country => "City Country" >- }; >- > $tx = $t->ua->build_tx( > PUT => "/api/v1/cities/$city_id" => json => $city_with_updated_field ); > $tx->req->cookies( >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18890
:
64774
|
64777
|
64778
|
68370
| 68371 |
68372