[ARVADOS] updated: 91526e84bf213e08b602fdbd4e7b69a18d401483
git at public.curoverse.com
git at public.curoverse.com
Mon Mar 24 18:10:02 EDT 2014
Summary of changes:
services/api/test/unit/user_test.rb | 34 +++++++++++++++++++++++++++++++++-
1 files changed, 33 insertions(+), 1 deletions(-)
via 91526e84bf213e08b602fdbd4e7b69a18d401483 (commit)
from a248323fdb1bfa315a3dc9af0a2362aa5b0a0f46 (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 91526e84bf213e08b602fdbd4e7b69a18d401483
Author: radhika chippada <radhika at radhika.curoverse>
Date: Mon Mar 24 18:09:24 2014 -0400
More unit testing
diff --git a/services/api/test/unit/user_test.rb b/services/api/test/unit/user_test.rb
index d42c3d1..e9886af 100644
--- a/services/api/test/unit/user_test.rb
+++ b/services/api/test/unit/user_test.rb
@@ -193,7 +193,39 @@ class UserTest < ActiveSupport::TestCase
'Expected ArgumentError'
end
- test "setup new user with email and openid_prefix" do
+ test "setup new user with all input data" do
+ Thread.current[:user] = @admin_user
+
+ email = 'abc at xyz.com'
+ openid_prefix = 'http://openid/prefix'
+
+ user = User.new
+ user.email = email
+
+ vm = VirtualMachine.create
+
+ response = User.setup user, openid_prefix, 'test_repo', vm.uuid
+
+ resp_user = response[:user]
+ verify_user resp_user, email
+
+ oid_login_perm = response[:oid_login_perm]
+ verify_link oid_login_perm, 'permission', 'can_login', resp_user[:email],
+ resp_user[:uuid]
+ assert_equal openid_prefix, oid_login_perm[:properties][:identity_url_prefix],
+ 'expected identity_url_prefix not found for oid_login_perm'
+
+ verify_link response[:group_perm], 'permission', 'can_read',
+ resp_user[:uuid], nil
+
+ verify_link response[:repo_perm], 'permission', 'can_write',
+ resp_user[:uuid], nil
+
+ verify_link response[:vm_login_perm], 'permission', 'can_login',
+ resp_user[:uuid], vm.uuid
+ end
+
+ test "setup new user in multiple steps" do
Thread.current[:user] = @admin_user
email = 'abc at xyz.com'
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list