X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e08c67024acccb83a30d2010c34862973b883585..68f12bfd1ca6612338ff65106f404019a28d0cd3:/services/api/test/unit/link_test.rb diff --git a/services/api/test/unit/link_test.rb b/services/api/test/unit/link_test.rb index 56a38045e4..e40326504a 100644 --- a/services/api/test/unit/link_test.rb +++ b/services/api/test/unit/link_test.rb @@ -13,6 +13,7 @@ class LinkTest < ActiveSupport::TestCase link_class: 'name', name: 'foo') assert a.valid?, a.errors.to_s + assert_equal groups(:aproject).uuid, a.owner_uuid assert_raises ActiveRecord::RecordNotUnique do b = Link.create!(tail_uuid: groups(:aproject).uuid, head_uuid: specimens(:owned_by_active_user).uuid, @@ -27,11 +28,13 @@ class LinkTest < ActiveSupport::TestCase link_class: 'name', name: 'foo') assert a.valid?, a.errors.to_s + assert_equal groups(:aproject).uuid, a.owner_uuid b = Link.create!(tail_uuid: groups(:asubproject).uuid, head_uuid: specimens(:owned_by_active_user).uuid, link_class: 'name', name: 'foo') assert b.valid?, b.errors.to_s + assert_equal groups(:asubproject).uuid, b.owner_uuid assert_not_equal(a.uuid, b.uuid, "created two links and got the same uuid back.") end @@ -52,6 +55,7 @@ class LinkTest < ActiveSupport::TestCase head_uuid: ob.uuid, link_class: 'test', name: 'test') + assert_equal users(:admin).uuid, link.owner_uuid assert_raises(ActiveRecord::DeleteRestrictionError, "should not delete #{ob.uuid} with link #{link.uuid}") do ob.destroy