[ARVADOS] updated: 7130989e6493555eba3491cfc9c8dddd1e1a545a

git at public.curoverse.com git at public.curoverse.com
Wed Apr 23 11:16:18 EDT 2014


Summary of changes:
 services/api/app/middlewares/arvados_api_token.rb |    2 +-
 services/api/test/test_helper.rb                  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

       via  7130989e6493555eba3491cfc9c8dddd1e1a545a (commit)
      from  923e2bd7d962f1a0feefc73ae4f4531c8235a591 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 7130989e6493555eba3491cfc9c8dddd1e1a545a
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Wed Apr 23 11:16:15 2014 -0400

    Test helper now users ArvadosApiToken rack middleware to set current user.

diff --git a/services/api/app/middlewares/arvados_api_token.rb b/services/api/app/middlewares/arvados_api_token.rb
index fac1916..24d013c 100644
--- a/services/api/app/middlewares/arvados_api_token.rb
+++ b/services/api/app/middlewares/arvados_api_token.rb
@@ -47,6 +47,6 @@ class ArvadosApiToken
       api_client_auth.save validate: false
     end
 
-    @app.call env
+    @app.call env if @app
   end
 end
diff --git a/services/api/test/test_helper.rb b/services/api/test/test_helper.rb
index a81bfdf..e9133b6 100644
--- a/services/api/test/test_helper.rb
+++ b/services/api/test/test_helper.rb
@@ -14,7 +14,7 @@ class ActiveSupport::TestCase
   end
 
   def authorize_with(api_client_auth_name)
-    self.request.env['HTTP_AUTHORIZATION'] = "OAuth2 #{api_client_authorizations(api_client_auth_name).api_token}"
+    ArvadosApiToken.new.call ({"rack.input" => "", "HTTP_AUTHORIZATION" => "OAuth2 #{api_client_authorizations(api_client_auth_name).api_token}"})
   end
 
   # Add more helper methods to be used by all tests here...

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list