spec/twitter/client/timeline_spec.rb in twitter4r-0.3.2 vs spec/twitter/client/timeline_spec.rb in twitter4r-0.5.0
- old
+ new
@@ -22,44 +22,44 @@
it "should respond to instance method #timeline_for" do
@client.should respond_to(:timeline_for)
end
it "should call #http_get with expected parameters for :public case" do
- @client.should_receive(:http_connect).and_return(mas_net_http_response(:success, @json))
+ @client.should_receive(:rest_oauth_connect).and_return(mas_net_http_response(:success, @json))
@client.timeline_for(:public)
end
it "should yield to block for each status in timeline" do
- @client.should_receive(:http_connect).and_return(mas_net_http_response(:success, @json))
+ @client.should_receive(:rest_oauth_connect).and_return(mas_net_http_response(:success, @json))
Twitter::Status.should_receive(:unmarshal).and_return(@timeline)
count = 0
@client.timeline_for(:public) do |status|
status.should eql(@status)
count += 1
end
count.should eql(@timeline.size)
end
it "should generate expected HTTP GET request for generic :public case" do
- @client.should_receive(:create_http_get_request).with(@uris[:public], {}).and_return(@request)
+ @client.should_receive(:rest_oauth_connect).with(:get, @uris[:public], {}).and_return(@response)
timeline = @client.timeline_for(:public)
timeline.should eql(@timeline)
end
it "should generate expected HTTP GET request for :public case with expected parameters" do
- @client.should_receive(:create_http_get_request).with(@uris[:public], @params[:public]).and_return(@request)
+ @client.should_receive(:rest_oauth_connect).with(:get, @uris[:public], @params[:public]).and_return(@response)
timeline = @client.timeline_for(:public, @params[:public])
timeline.should eql(@timeline)
end
it "should generate expected HTTP GET request for generic :friends case" do
- @client.should_receive(:create_http_get_request).with(@uris[:friends], {}).and_return(@request)
+ @client.should_receive(:rest_oauth_connect).with(:get, @uris[:friends], {}).and_return(@response)
timeline = @client.timeline_for(:friends)
timeline.should eql(@timeline)
end
it "should generate expected HTTP GET request for :friends case with expected parameters" do
- @client.should_receive(:create_http_get_request).with(@uris[:friends], @params[:friends]).and_return(@request)
+ @client.should_receive(:rest_oauth_connect).with(:get, @uris[:friends], @params[:friends]).and_return(@response)
timeline = @client.timeline_for(:friends, @params[:friends])
timeline.should eql(@timeline)
end
it "should raise an ArgumentError if type given is not valid" do