File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ def list_object_type?(object_type)
3131 end
3232
3333 def deserialize_collection ( collection_json )
34+ return [ ] if collection_json == nil
3435 collection_json . map { |item_json | TypedJsonDeserializer . new ( item_json ) . deserialize }
3536 end
3637
Original file line number Diff line number Diff line change 4141 payload = Intercom ::Notification . new ( test_conversation_notification )
4242 payload . model . user . must_be_instance_of Intercom ::User
4343 end
44+
45+ it "returns inner User object with nil tags" do
46+ user_notification = {
47+ "type" => "notification_event" ,
48+ "app_id" => "aa11aa" ,
49+ "data" => {
50+ "type" => "notification_event_data" ,
51+ "item" => {
52+ "type" => "user" ,
53+ "id" => "abc123def" ,
54+ "user_id" => "666" ,
55+ 56+ "name" => "Joe" ,
57+ "tags" => {
58+ "type" => "tag.list" ,
59+ "tags" => nil
60+ }
61+ }
62+ } ,
63+ }
64+ payload = Intercom ::Notification . new ( user_notification )
65+ payload . model . tags . must_equal ( [ ] )
66+ end
4467
45- end
68+ end
You can’t perform that action at this time.
0 commit comments