Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

added received_events api #91

Merged
merged 2 commits into from

2 participants

@hsbt

I added user received events in github api v3. My products(https://github.com/hsbt/agig) needs this api.

@pengwynn pengwynn merged commit 8cfad62 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 18, 2012
  1. @hsbt

    added received_events api

    hsbt authored
  2. @hsbt

    docs

    hsbt authored
This page is out of date. Refresh to see the latest.
Showing with 20 additions and 1 deletion.
  1. +10 −0 lib/octokit/client/events.rb
  2. +10 −1 spec/octokit/client/events_spec.rb
View
10 lib/octokit/client/events.rb
@@ -21,6 +21,16 @@ def user_events(user, options={})
get("/users/#{user}/events", options, 3)
end
+ # List events that a user has received
+ #
+ # @return [Array] A list of all user received events
+ # @see http://developer.github.com/v3/received_events
+ # @example List all user received events
+ # Octokit.received_events("sferik")
+ def received_events(user, options={})
+ get("/users/#{user}/received_events", options, 3)
+ end
+
# List events for a repository
#
# @param repo [String, Repository, Hash] A GitHub repository
View
11 spec/octokit/client/events_spec.rb
@@ -14,7 +14,7 @@
public_events.first.id.should == '1513284759'
end
end
-
+
describe ".user_events" do
it "should return all user events" do
stub_get("/users/sferik/events").
@@ -24,6 +24,15 @@
end
end
+ describe ".received_events" do
+ it "should return all user received events" do
+ stub_get("/users/sferik/received_events").
+ to_return(:body => fixture("v3/user_events.json"))
+ received_events = @client.received_events('sferik')
+ received_events.first.type.should == 'PushEvent'
+ end
+ end
+
describe ".repository_events" do
it "should return events for a repository" do
stub_get("/repos/sferik/rails_admin/events").
Something went wrong with that request. Please try again.