initial commit

This commit is contained in:
2018-01-20 13:02:44 -03:00
commit 203138a969
650 changed files with 19523 additions and 0 deletions
@@ -0,0 +1,19 @@
require 'rails_helper'
describe WorkflowInstance::IndexCsvBuilder do
it "handles windows carriage returns" do
wi = create :workflow_instance_scenario1
wi.owner_initialization.update(my_explanation: "My explanation\r\n having multiple\rlines\n with extra")
expected_csv = <<-CSV.strip_heredoc
SC1,Core initialisatie,HazBeenChecked,Dattum,My identifier,Window from,Window to,Number of visits,My fraction,My explanation,Contr. initialisatie
,pending,0,,,,,,,My explanation having multiple lines with extra,pending
CSV
result = described_class.new([wi], controller: double(record_class: WorkflowInstance::Scenario1)).data
result.should eq expected_csv
# works with single resource as well
result = described_class.new(wi, controller: double(record_class: WorkflowInstance::Scenario1)).data
result.should eq expected_csv
end
end