@@ -132,6 +132,136 @@ def test_tag
132132 }
133133end
134134
135+ def test_user_notification
136+ {
137+ "type" => "notification_event" ,
138+ "id" => "notif_123456-56465-546546" ,
139+ "topic" => "user.created" ,
140+ "app_id" => "aaaaaa" ,
141+ "data" =>
142+ {
143+ "type" => "notification_event_data" ,
144+ "item" =>
145+ {
146+ "type" => "user" ,
147+ "id" => "aaaaaaaaaaaaaaaaaaaaaaaa" ,
148+ "user_id" => nil ,
149+ "email" => "joe@example.com" ,
150+ "name" => "Joe Schmoe" ,
151+ "avatar" =>
152+ {
153+ "type" => "avatar" ,
154+ "image_url" => nil
155+ } ,
156+ "app_id" => "aaaaa" ,
157+ "companies" =>
158+ {
159+ "type" => "company.list" ,
160+ "companies" => [ ]
161+ } ,
162+ "location_data" =>
163+ {
164+ } ,
165+ "last_request_at" => nil ,
166+ "created_at" => "1401970114" ,
167+ "remote_created_at" => nil ,
168+ "updated_at" => "1401970114" ,
169+ "session_count" => 0 ,
170+ "social_profiles" =>
171+ {
172+ "type" => "social_profile.list" ,
173+ "social_profiles" => [ ]
174+ } ,
175+ "unsubscribed_from_emails" => false ,
176+ "user_agent_data" => nil ,
177+ "tags" =>
178+ {
179+ "type" => "tag.list" ,
180+ "tags" => [ ]
181+ } ,
182+ "segments" =>
183+ {
184+ "type" => "segment.list" ,
185+ "segments" => [ ]
186+ } ,
187+ "custom_attributes" =>
188+ {
189+ }
190+ }
191+ } ,
192+ "delivery_status" => nil ,
193+ "delivery_attempts" => 1 ,
194+ "delivered_at" => 0 ,
195+ "first_sent_at" => 1410188629 ,
196+ "created_at" => 1410188628 ,
197+ "links" => { } ,
198+ "self" => nil
199+ }
200+ end
201+
202+ def test_conversation_notification
203+ {
204+ "type" => "notification_event" ,
205+ "id" => "notif_123456-56465-546546" ,
206+ "topic" => "conversation.user.created" ,
207+ "app_id" => "aaaaa" ,
208+ "data" =>
209+ {
210+ "type" => "notification_event_data" ,
211+ "item" =>
212+ {
213+ "type" => "conversation" ,
214+ "id" => "123456789" ,
215+ "created_at" => "1410335293" ,
216+ "updated_at" => "1410335293" ,
217+ "user" =>
218+ {
219+ "type" => "user" ,
220+ "id" => "540f1de7112d3d1d51001637" ,
221+ "name" => "Kill Bill" ,
222+ "email" => "bill@bill.bill" } ,
223+ "assignee" =>
224+ {
225+ "type" => "nobody_admin" ,
226+ "id" => nil
227+ } ,
228+ "conversation_message" =>
229+ {
230+ "type" => "conversation_message" ,
231+ "id" => "321546" ,
232+ "subject" => "" ,
233+ "body" => "<p>An important message</p>" ,
234+ "author" =>
235+ {
236+ "type" => "user" ,
237+ "id" => "aaaaaaaaaaaaaaaaaaaaaa" ,
238+ "name" => "Kill Bill" ,
239+ "email" => "bill@bill.bill" } ,
240+ "attachments" => [ ]
241+ } ,
242+ "conversation_parts" =>
243+ {
244+ "type" => "conversation_part.list" ,
245+ "conversation_parts" => [ ]
246+ } ,
247+ "open" => nil ,
248+ "read" => true ,
249+ "links" =>
250+ {
251+ "conversation_web" =>
252+ "https://app.intercom.io/a/apps/aaaaaa/inbox/all/conversations/123456789" }
253+ }
254+ } ,
255+ "delivery_status" => nil ,
256+ "delivery_attempts" => 1 ,
257+ "delivered_at" => 0 ,
258+ "first_sent_at" => 1410335293 ,
259+ "created_at" => 1410335293 ,
260+ "links" => { } ,
261+ "self" => nil
262+ }
263+ end
264+
135265def error_on_modify_frozen
136266 RUBY_VERSION =~ /1.8/ ? TypeError : RuntimeError
137267end
0 commit comments