From 0aaa8e5cad498be9f4cce3b205fbf84697fa696b Mon Sep 17 00:00:00 2001 From: d-m-u <drewuhlmann@gmail.com> Date: Wed, 31 Jan 2018 15:01:24 -0500 Subject: [PATCH] Add empty array to test UI update format of empty dialog field associations --- spec/lib/services/dialog_import_service_spec.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/lib/services/dialog_import_service_spec.rb b/spec/lib/services/dialog_import_service_spec.rb index f2dc1e5acc7..c3029271646 100644 --- a/spec/lib/services/dialog_import_service_spec.rb +++ b/spec/lib/services/dialog_import_service_spec.rb @@ -496,12 +496,16 @@ let(:field1) { {"name" => "field1", "dialog_field_responders" => %w(field2 field3)} } let(:field2) { {"name" => "field2", "dialog_field_responders" => %w(field3)} } - let(:field3) { {"name" => "field3"} } + let(:field3) { {"name" => "field3", "dialog_field_responders" => []} } it "creates an association list of ids based on names" do expect(dialog_import_service.build_association_list(dialog)).to eq( [{"field1" => %w(field2 field3)}, {"field2" => %w(field3)}] ) end + + it "association list doesn't include empty arrays" do + expect(dialog_import_service.build_association_list(dialog)).not_to include("field3" => []) + end end end