spec/unit/intercom/notification_spec.rb in intercom-2.4.3 vs spec/unit/intercom/notification_spec.rb in intercom-2.4.4
- old
+ new
@@ -39,7 +39,30 @@
it "returns inner User object for Conversation" do
payload = Intercom::Notification.new(test_conversation_notification)
payload.model.user.must_be_instance_of Intercom::User
end
+
+ it "returns inner User object with nil tags" do
+ user_notification = {
+ "type" => "notification_event",
+ "app_id" => "aa11aa",
+ "data" => {
+ "type" => "notification_event_data",
+ "item" => {
+ "type" => "user",
+ "id" => "abc123def",
+ "user_id" => "666",
+ "email" => "joe@example.com",
+ "name" => "Joe",
+ "tags" => {
+ "type" => "tag.list",
+ "tags" => nil
+ }
+ }
+ },
+ }
+ payload = Intercom::Notification.new(user_notification)
+ payload.model.tags.must_equal([])
+ end
-end
\ No newline at end of file
+end