Sha256: 5c8711e2cef24972e1bff9ffa1bee9b43d5c6f1d5ad5683a148dda4d710c195e
Contents?: true
Size: 1.54 KB
Versions: 33
Compression:
Stored size: 1.54 KB
Contents
# -*- encoding: utf-8 -*- require 'helper' describe Octokit::Client::PubSubHubbub::ServiceHooks do let(:client) { Octokit::Client.new(:oauth_token => 'myfaketoken') } describe "subscribe_service_hook" do let(:subscribe_request_body) { { :"hub.callback" => 'github://Travis?token=travistoken', :"hub.mode" => 'subscribe', :"hub.topic" => 'https://github.com/joshk/completeness-fu/events/push' } } it "subscribes to pull events on specified topic" do stub_post("/hub?access_token=myfaketoken"). with(subscribe_request_body). to_return(:body => nil) client.subscribe_service_hook("joshk/completeness-fu", "Travis", { :token => 'travistoken' }).should == true assert_requested :post, "https://api.github.com/hub?access_token=myfaketoken", :body => subscribe_request_body, :times => 1 end end describe "unsubscribe_service_hook" do let(:unsubscribe_request_body) { { :"hub.callback" => 'github://Travis', :"hub.mode" => 'unsubscribe', :"hub.topic" => 'https://github.com/joshk/completeness-fu/events/push' } } it "unsubscribes to stop receiving events on specified topic" do stub_post("/hub?access_token=myfaketoken"). with(unsubscribe_request_body). to_return(:body => nil) client.unsubscribe_service_hook("joshk/completeness-fu", "Travis").should == true assert_requested :post, "https://api.github.com/hub?access_token=myfaketoken", :body => unsubscribe_request_body, :times => 1 end end end
Version data entries
33 entries across 33 versions & 1 rubygems