Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

50 lines (44 sloc) 1.548 kB
require 'helper'
describe Twitter::API do
before do
@client = Twitter::Client.new
end
describe "#enable_notifications" do
before do
stub_post("/1.1/notifications/follow.json").
with(:body => {:screen_name => "sferik"}).
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
end
it "requests the correct resource" do
@client.enable_notifications("sferik")
a_post("/1.1/notifications/follow.json").
with(:body => {:screen_name => "sferik"}).
should have_been_made
end
it "returns an array of users" do
users = @client.enable_notifications("sferik")
users.should be_an Array
users.first.should be_a Twitter::User
users.first.id.should eq 7505382
end
end
describe "#disable_notifications" do
before do
stub_post("/1.1/notifications/leave.json").
with(:body => {:screen_name => "sferik"}).
to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
end
it "requests the correct resource" do
@client.disable_notifications("sferik")
a_post("/1.1/notifications/leave.json").
with(:body => {:screen_name => "sferik"}).
should have_been_made
end
it "returns an array of users" do
users = @client.disable_notifications("sferik")
users.should be_an Array
users.first.should be_a Twitter::User
users.first.id.should eq 7505382
end
end
end
Jump to Line
Something went wrong with that request. Please try again.