Sha256: 67bc7b3dfcfc7a3fd0f2902cd27a87deb637bda33e2d5e173c7c901d4ab1eb0c

Contents?: true

Size: 1.34 KB

Versions: 2

Compression:

Stored size: 1.34 KB

Contents

# -*- encoding: utf-8 -*-
require 'helper'

describe Octokit::Client::Events do
  before do
    @client = Octokit::Client.new(:login => 'sferik')
  end

  describe ".public_events" do
    it "returns all public events" do
      stub_get("/events").
        to_return(:body => fixture("v3/public_events.json"))
      public_events = @client.public_events
      expect(public_events.first.id).to eq('1513284759')
    end
  end

  describe ".user_events" do
    it "returns all user events" do
      stub_get("/users/sferik/events").
        to_return(:body => fixture("v3/user_events.json"))
      user_events = @client.user_events('sferik')
      expect(user_events.first.id).to eq('1525888969')
    end
  end

  describe ".received_events" do
    it "returns 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')
      expect(received_events.first.type).to eq('PushEvent')
    end
  end

  describe ".repository_events" do
    it "returns events for a repository" do
      stub_get("/repos/sferik/rails_admin/events").
        to_return(:body => fixture("v3/repo_events.json"))
      repo_events = @client.repository_events("sferik/rails_admin")
      expect(repo_events.first.type).to eq("IssuesEvent")
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
octokit-1.18.0 spec/octokit/client/events_spec.rb
octokit-1.17.1 spec/octokit/client/events_spec.rb