Merge branch '21535-multi-wf-delete'
[arvados.git] / services / api / test / unit / link_test.rb
index 5d36653a569f82315cf642ffb6206438340a553a..fb0d0283377a6828a972629edc8447f1177a3bc3 100644 (file)
@@ -13,7 +13,7 @@ class LinkTest < ActiveSupport::TestCase
 
   test "cannot delete an object referenced by unwritable links" do
     ob = act_as_user users(:active) do
-      Specimen.create
+      Collection.create
     end
     link = act_as_user users(:admin) do
       Link.create(tail_uuid: users(:active).uuid,
@@ -109,7 +109,7 @@ class LinkTest < ActiveSupport::TestCase
 
   test "updating permission causes any conflicting links to be deleted" do
     link1, link2 = create_overlapping_permissions(['can_read', 'can_manage'])
-    Link.find_by_uuid(link2).update_attributes!(name: 'can_write')
+    Link.find_by_uuid(link2).update!(name: 'can_write')
     assert_empty Link.where(uuid: link1)
   end
 
@@ -121,8 +121,8 @@ class LinkTest < ActiveSupport::TestCase
 
   test "updating login permission causes any conflicting links to be deleted" do
     link1, link2 = create_overlapping_permissions(['can_login', 'can_login'], {properties: {username: 'foo1'}})
-    Link.find_by_uuid(link1).update_attributes!(properties: {'username' => 'foo2'})
-    Link.find_by_uuid(link2).update_attributes!(properties: {'username' => 'foo2'})
+    Link.find_by_uuid(link1).update!(properties: {'username' => 'foo2'})
+    Link.find_by_uuid(link2).update!(properties: {'username' => 'foo2'})
     assert_empty Link.where(uuid: link1)
   end