@@ -131,7 +131,7 @@ def test_response_data(self, mock_requests):
131131 response = self .client .post (url , body )
132132 for key in response .data :
133133 self .assertIn (key , ['uuid' , 'owner' , 'created' , 'updated' , 'app' , 'values' , 'memory' ,
134- 'cpu' , 'tags' , 'registry' , 'healthcheck' ])
134+ 'cpu' , 'tags' , 'registry' , 'healthcheck' , 'routable' ])
135135 expected = {
136136 'owner' : self .user .username ,
137137 'app' : app_id ,
@@ -154,7 +154,7 @@ def test_response_data_types_converted(self, mock_requests):
154154 self .assertEqual (response .status_code , 201 , response .data )
155155 for key in response .data :
156156 self .assertIn (key , ['uuid' , 'owner' , 'created' , 'updated' , 'app' , 'values' , 'memory' ,
157- 'cpu' , 'tags' , 'registry' , 'healthcheck' ])
157+ 'cpu' , 'tags' , 'registry' , 'healthcheck' , 'routable' ])
158158 expected = {
159159 'owner' : self .user .username ,
160160 'app' : app_id ,
@@ -325,3 +325,21 @@ def test_unauthorized_user_cannot_modify_config(self, mock_requests):
325325 body = {'values' : {'FOO' : 'bar' }}
326326 response = self .client .post (url , body )
327327 self .assertEqual (response .status_code , 403 )
328+
329+ def test_config_routable (self , mock_requests ):
330+ """
331+ Create an application with the routable flag turned on or off
332+ """
333+ # create app, expecting routable to be true
334+ body = {'id' : 'myid' }
335+ response = self .client .post ('/v2/apps' , body )
336+ self .assertEqual (response .status_code , 201 , response .data )
337+ app = App .objects .get (id = 'myid' )
338+ self .assertTrue (app .config_set .latest ().routable )
339+ # Set routable to false
340+ response = self .client .post (
341+ '/v2/apps/{app.id}/config' .format (** locals ()),
342+ {'routable' : False }
343+ )
344+ self .assertEqual (response .status_code , 201 , response .data )
345+ self .assertFalse (app .config_set .latest ().routable )
0 commit comments