1010 let ( :standard_field_path ) { File . join ( inference_path , 'standard_field_types.json' ) }
1111 let ( :standard_field_rst_path ) { File . join ( inference_path , 'standard_field_types.rst' ) }
1212 let ( :location_field_path ) { File . join ( findoc_path , 'complete_with_coordinates.json' ) }
13- let ( :raw_text_path ) { File . join ( inference_path , 'raw_texts.json' ) }
13+ let ( :raw_text_json_path ) { File . join ( inference_path , 'raw_texts.json' ) }
14+ let ( :raw_text_str_path ) { File . join ( inference_path , 'raw_texts.txt' ) }
1415 let ( :blank_path ) { File . join ( findoc_path , 'blank.json' ) }
1516 let ( :complete_path ) { File . join ( findoc_path , 'complete.json' ) }
1617
@@ -268,7 +269,7 @@ def load_standard_fields
268269
269270 describe 'raw_text' do
270271 it 'exposes raw texts' do
271- response = load_v2_inference ( raw_text_path )
272+ response = load_v2_inference ( raw_text_json_path )
272273
273274 active_options = response . inference . active_options
274275 expect ( active_options ) . not_to be_nil
@@ -278,10 +279,16 @@ def load_standard_fields
278279 expect ( raw_text ) . not_to be_nil
279280 expect ( raw_text ) . to be_a ( Mindee ::Parsing ::V2 ::RawText )
280281
282+ expect ( raw_text . to_s ) . to eq ( File . read ( raw_text_str_path , encoding : 'UTF-8' ) )
283+
281284 expect ( raw_text . pages . length ) . to eq ( 2 )
282285 first = raw_text . pages . first
283286 expect ( first ) . to be_a ( Mindee ::Parsing ::V2 ::RawTextPage )
284287 expect ( first . content ) . to eq ( 'This is the raw text of the first page...' )
288+
289+ raw_text . pages . each do |page |
290+ expect ( page . content ) . to be_a ( String )
291+ end
285292 end
286293 end
287294
0 commit comments