File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 398398 end
399399 end
400400
401+ context "when there are no partners" do
402+ let ( :partners ) { Partner . none }
403+ it "should have the correct headers and no other rows" do
404+ expect ( subject [ 0 ] ) . to eq ( headers_base + partial_to_headers . values . flatten )
405+ expect ( subject [ 1 ] ) . to eq ( nil )
406+ end
407+
408+ it "should only export columns in profile sections the org has enabled" do
409+ partial_to_headers . keys . each do |partial |
410+ organization . update ( partner_form_fields : [ partial ] )
411+ partners . reload
412+ limited_export = CSV . parse ( described_class . new ( partners , organization ) . generate_csv )
413+ expect ( limited_export [ 0 ] ) . to eq ( headers_base + partial_to_headers [ partial ] )
414+ expect ( limited_export [ 1 ] ) . to eq ( nil )
415+ end
416+ end
417+ end
418+
401419 context "when partner has a distribution in the last 12 months" do
402420 let ( :distribution ) { create ( :distribution , partner : partner ) }
403421
You can’t perform that action at this time.
0 commit comments