X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/2a30f6a162a59ff5a75b9fcdef4913baeeae6a1e..65121f8db54a1ed15207d050e1f48c5fc26d646b:/services/api/test/unit/user_test.rb diff --git a/services/api/test/unit/user_test.rb b/services/api/test/unit/user_test.rb index 4df6cc0b36..3bd6ed4003 100644 --- a/services/api/test/unit/user_test.rb +++ b/services/api/test/unit/user_test.rb @@ -136,7 +136,6 @@ class UserTest < ActiveSupport::TestCase test "admin can't clear username when user owns repositories" do set_user_from_auth :admin user = users(:active) - start_username = user.username user.username = nil assert_not_allowed { user.save } refute_empty(user.errors[:username]) @@ -277,10 +276,12 @@ class UserTest < ActiveSupport::TestCase assert @uninvited_user.can? :write=>"#{@uninvited_user.uuid}" assert @uninvited_user.can? :manage=>"#{@uninvited_user.uuid}" - assert @uninvited_user.groups_i_can(:read).size == 1, "inactive and uninvited user can only read anonymous user group" - assert @uninvited_user.groups_i_can(:read).first.ends_with? 'anonymouspublic' , "inactive and uninvited user can only read anonymous user group" - assert @uninvited_user.groups_i_can(:write).size == 0, "inactive and uninvited user should not be able write to any groups" - assert @uninvited_user.groups_i_can(:manage).size == 0, "inactive and uninvited user should not be able manage any groups" + assert_equal(@uninvited_user.groups_i_can(:read).sort, + [@uninvited_user.uuid, groups(:anonymous_group).uuid].sort) + assert_equal(@uninvited_user.groups_i_can(:write), + [@uninvited_user.uuid]) + assert_equal(@uninvited_user.groups_i_can(:manage), + [@uninvited_user.uuid]) end test "find user method checks" do