@@ -61,24 +61,24 @@ class ContentTest < ActiveSupport::TestCase
6161
6262 # Without optional text or blob
6363 resource = Resource . new ( uri , mime_type )
64- expected = { type : "resource" , uri : uri , mimeType : mime_type }
64+ expected = { type : "resource" , resource : { uri : uri , mimeType : mime_type } }
6565 assert_equal expected , resource . to_h
6666
6767 # With text only
6868 text_content = "Optional text"
6969 resource_with_text = Resource . new ( uri , mime_type , text : text_content )
70- expected_with_text = { type : "resource" , uri : uri , mimeType : mime_type , text : text_content }
70+ expected_with_text = { type : "resource" , resource : { uri : uri , mimeType : mime_type , text : text_content } }
7171 assert_equal expected_with_text , resource_with_text . to_h
7272
7373 # With blob only
7474 blob_content = "base64encodedblob"
7575 resource_with_blob = Resource . new ( uri , mime_type , blob : blob_content )
76- expected_with_blob = { type : "resource" , uri : uri , mimeType : mime_type , blob : blob_content }
76+ expected_with_blob = { type : "resource" , resource : { uri : uri , mimeType : mime_type , blob : blob_content } }
7777 assert_equal expected_with_blob , resource_with_blob . to_h
7878
7979 # With both text and blob
8080 resource_full = Resource . new ( uri , mime_type , text : text_content , blob : blob_content )
81- expected_full = { type : "resource" , uri : uri , mimeType : mime_type , text : text_content , blob : blob_content }
81+ expected_full = { type : "resource" , resource : { uri : uri , mimeType : mime_type , text : text_content , blob : blob_content } }
8282 assert_equal expected_full , resource_full . to_h
8383 end
8484
@@ -87,7 +87,7 @@ class ContentTest < ActiveSupport::TestCase
8787 mime_type = "application/pdf"
8888 annotations = { "audience" => [ "user" ] , "priority" => 1 }
8989 resource = Resource . new ( uri , mime_type , annotations : annotations )
90- expected = { type : "resource" , uri : uri , mimeType : mime_type , annotations : annotations }
90+ expected = { type : "resource" , resource : { uri : uri , mimeType : mime_type , annotations : annotations } }
9191 assert_equal annotations , resource . annotations
9292 assert_equal expected , resource . to_h
9393 end
0 commit comments