[ARVADOS] updated: 0496ff36445af8eae98914b91869ac52d951148e

git at public.curoverse.com git at public.curoverse.com
Wed Mar 19 12:13:21 EDT 2014


Summary of changes:
 .../app/controllers/arvados/v1/users_controller.rb |    1 +
 .../functional/arvados/v1/users_controller_test.rb |   18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

       via  0496ff36445af8eae98914b91869ac52d951148e (commit)
      from  7112a411de36be33f6857aea3bc750a87b139854 (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 0496ff36445af8eae98914b91869ac52d951148e
Author: radhika chippada <radhika at radhika.curoverse>
Date:   Wed Mar 19 12:00:10 2014 -0400

    When using user_param, the user object is not expected. If passed, it will be discarded.

diff --git a/services/api/app/controllers/arvados/v1/users_controller.rb b/services/api/app/controllers/arvados/v1/users_controller.rb
index ebb5203..a929476 100644
--- a/services/api/app/controllers/arvados/v1/users_controller.rb
+++ b/services/api/app/controllers/arvados/v1/users_controller.rb
@@ -109,6 +109,7 @@ class Arvados::V1::UsersController < ApplicationController
 		  end
 
 			if !@object_found
+				@object = User.new		# when user_param is used, it will be used as user object
 				@object[:email] = params[:user_param]				
   	 		need_to_create = true
 			else
diff --git a/services/api/test/functional/arvados/v1/users_controller_test.rb b/services/api/test/functional/arvados/v1/users_controller_test.rb
index 379db9b..b7ad8dd 100644
--- a/services/api/test/functional/arvados/v1/users_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/users_controller_test.rb
@@ -162,6 +162,24 @@ class Arvados::V1::UsersControllerTest < ActionController::TestCase
     assert_equal response_object['email'], 'abc at xyz.com', 'expecting given email'
 	end
 
+	test "create user with user_param and user which will be ignored" do
+    authorize_with :admin
+
+    post :create, {
+      user_param: 'abc at xyz.com',
+      repo_name: 'test_repo',
+			vm_uuid: 'no_such_vm',
+      user: {
+				email: 'will_be_ignored at xyz.om'
+			}
+    }
+
+    assert_response :success
+    response_object = JSON.parse(@response.body)
+    assert_not_nil response_object['uuid'], 'expected non-null uuid for the newly created user'
+    assert_equal response_object['email'], 'abc at xyz.com', 'expecting user_param as email'
+	end
+
 	test "create user with valid email user_param, vm and repo as input with opt.n" do
     authorize_with :admin
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list