spec/stratify-github/activity_spec.rb in stratify-github-0.1.2 vs spec/stratify-github/activity_spec.rb in stratify-github-0.1.3

- old
+ new

@@ -249,9 +249,22 @@ event.ref.should == 'refs/head/master' event.repository.should be_nil event.payload.should == 'Fix all the things' end + it 'produces correct fields for a PushEvent without SHAs' do + data = DM({'type' => 'PushEvent', + 'payload' => { + 'ref' => 'refs/head/master', + 'shas' => []}}) + event = Stratify::GitHub::Activity.from_api_hash(data) + event.action.should == 'pushed' + event.event_type.should == 'PushEvent' + event.ref.should == 'refs/head/master' + event.repository.should be_nil + event.payload.should be_nil + end + it 'produces correct fields for a WatchEvent' do data = DM({'type' => 'WatchEvent'}) event = Stratify::GitHub::Activity.from_api_hash(data) event.event_type.should == 'WatchEvent' end