diff --git a/unittests/test_json_schema_exporter.py b/unittests/test_json_schema_exporter.py
index 9fc597cd3c76c6fee2b533dda4e3160f24c649dc..b6ef35e6f5080c11971e8b1e1a7ffb610b8352e5 100644
--- a/unittests/test_json_schema_exporter.py
+++ b/unittests/test_json_schema_exporter.py
@@ -270,8 +270,8 @@ def test_rt_with_list_props():
 
 @patch("linkahead.execute_query", new=Mock(side_effect=_mock_execute_query))
 def test_rt_with_references():
-    """References and lists of references will come later, so test if the errors
-    are thrown correctly.
+    """References and lists of references to files will come later, so test if
+    the errors are thrown correctly.
 
     """
 
@@ -280,11 +280,35 @@ def test_rt_with_references():
 
     schema = rtjs(rt)
     props = schema["properties"]
+    assert "RefProp" in props
+    assert "enum" in props["RefProp"]
+    assert isinstance(props["RefProp"]["enum"], list)
+    assert len(props["RefProp"]["enum"]) == len(
+        db.execute_query("SELECT name, id FROM RECORD")) + len(
+            db.execute_query("SELECT name, id FROM FILE"))
+    assert "oneOf" not in props["RefProp"]
 
     rt = db.RecordType()
     rt.add_property(name="RefProp", datatype="OtherType")
 
     schema = rtjs(rt)
+    props = schema["properties"]
+    assert "RefProp" in props
+    assert "oneOf" in props["RefProp"]
+    assert len(props["RefProp"]["oneOf"]) == 2
+    enum_index = 0
+    if "enum" not in props["RefProp"]["oneOf"][enum_index]:
+        # We can't really require the order here, so we just know that one of
+        # the two elements must be the enum, the other the object.
+        enum_index = 1 - enum_index
+    assert "enum" in props["RefProp"]["oneOf"][enum_index]
+    assert isinstance(props["RefProp"]["oneOf"][enum_index]["enum"], list)
+    assert len(props["RefProp"]["oneOf"][enum_index]["enum"]) == 3
+    assert "100, otherA" in props["RefProp"]["oneOf"][enum_index]["enum"]
+    assert "101, otherB" in props["RefProp"]["oneOf"][enum_index]["enum"]
+    assert "102" in props["RefProp"]["oneOf"][enum_index]["enum"]
+    # the other element of oneOf is the OtherType object
+    assert props["RefProp"]["oneOf"][1 - enum_index]["type"] == "object"
 
     rt = db.RecordType()
     rt.add_property(name="RefProp", datatype=db.LIST(db.REFERENCE))