File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 344344 }
345345
346346 it "should have the correct headers" do
347- expected_headers = headers_base + partial_to_headers . values . flatten
348- expect ( subject [ 0 ] ) . to eq ( expected_headers )
347+ expect ( subject [ 0 ] ) . to eq ( headers_base + partial_to_headers . values . flatten )
349348 end
350349
351350 it "should have the expected info in the columns order" do
352- expected_values = values_base + partial_to_values . values . flatten
353- expect ( subject [ 1 ] ) . to eq ( expected_values )
351+ expect ( subject [ 1 ] ) . to eq ( values_base + partial_to_values . values . flatten )
352+ end
353+
354+ it "should handle a partner with missing profile info" do
355+ # The partner_profile factory defaults to populating the website, primary_contact_name, and primary_contact_email fields
356+ partners . first . update ( profile : create (
357+ :partner_profile ,
358+ website : nil ,
359+ primary_contact_name : nil ,
360+ primary_contact_email : nil
361+ ) )
362+ expected_value_base = [
363+ partner . name ,
364+ partner . email ,
365+ ", " ,
366+ "" ,
367+ "" ,
368+ "" ,
369+ "" ,
370+ "" ,
371+ "" ,
372+ "" ,
373+ "" ,
374+ "" ,
375+ "" ,
376+ enable_child_based_requests . to_s ,
377+ enable_individual_requests . to_s ,
378+ enable_quantity_based_requests . to_s ,
379+ ", " ,
380+ "" ,
381+ "" ,
382+ "" ,
383+ notes ,
384+ "" ,
385+ providing_diapers [ :value ] ,
386+ providing_period_supplies [ :value ]
387+ ]
388+ expect ( subject [ 1 ] ) . to eq ( expected_value_base + Array . new ( partial_to_values . values . flatten . count ) { "" } )
354389 end
355390
356391 it "should only export columns in profile sections the org has enabled" do
You can’t perform that action at this time.
0 commit comments