Skip to content

Commit

Permalink
Add empty array to test UI update format of empty dialog field associ…
Browse files Browse the repository at this point in the history
…ations
  • Loading branch information
d-m-u committed Jan 31, 2018
1 parent 80a4756 commit 0aaa8e5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec/lib/services/dialog_import_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0aaa8e5

Please sign in to comment.