File tree 2 files changed +25
-1
lines changed
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)
31
31
end
32
32
33
33
def deserialize_collection ( collection_json )
34
+ return [ ] if collection_json == nil
34
35
collection_json . map { |item_json | TypedJsonDeserializer . new ( item_json ) . deserialize }
35
36
end
36
37
Original file line number Diff line number Diff line change 41
41
payload = Intercom ::Notification . new ( test_conversation_notification )
42
42
payload . model . user . must_be_instance_of Intercom ::User
43
43
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
44
67
45
- end
68
+ end
You can’t perform that action at this time.
0 commit comments