File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
spec/strava/webhooks/models Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ require 'spec_helper'
4+
5+ RSpec . describe Strava ::Webhooks ::Models ::Event do
6+ let ( :event_data ) do
7+ {
8+ 'aspect_type' => 'update' ,
9+ 'event_time' => 1_516_126_040 ,
10+ 'object_id' => 1_360_128_428 ,
11+ 'object_type' => 'activity' ,
12+ 'owner_id' => 134_815 ,
13+ 'subscription_id' => 120_475 ,
14+ 'updates' => {
15+ 'title' => 'Messy'
16+ }
17+ }
18+ end
19+
20+ let ( :event ) { described_class . new ( event_data ) }
21+
22+ it 'parses event' do
23+ expect ( event . id ) . to eq 1_360_128_428
24+ expect ( event . aspect_type ) . to eq 'update'
25+ expect ( event . event_time ) . to eq Time . at ( 1_516_126_040 )
26+ expect ( event . object_type ) . to eq 'activity'
27+ expect ( event . owner_id ) . to eq 134_815
28+ expect ( event . subscription_id ) . to eq 120_475
29+ expect ( event . updates ) . to eq ( 'title' => 'Messy' )
30+ end
31+ end
You can’t perform that action at this time.
0 commit comments