spec/twitter/client/messaging_spec.rb in twitter4r-0.2.0 vs spec/twitter/client/messaging_spec.rb in twitter4r-0.2.1
- old
+ new
@@ -50,15 +50,17 @@
@uris = Twitter::Client.class_eval("@@MESSAGING_URIS")
@request = mas_net_http_get(:basic_auth => nil)
@json = JSON.unparse(@attributes)
@response = mas_net_http_response(:success, @json)
@connection = mas_net_http(@response)
+ @source = Twitter::Client.class_eval("@@defaults[:source]")
+
Net::HTTP.stub!(:new).and_return(@connection)
Twitter::Message.stub!(:unmarshal).and_return(@message)
end
it "should invoke #http_connect with expected arguments for :post case" do
- @twitter.should_receive(:http_connect).with({:text => @message.text, :user => @message.recipient.to_i}.to_http_str).and_return(@response)
+ @twitter.should_receive(:http_connect).with({:text => @message.text, :user => @message.recipient.to_i, :source => @source}.to_http_str).and_return(@response)
@twitter.message(:post, @message.text, @message.recipient)
end
it "should create expected HTTP POST request for :post case" do
@twitter.should_receive(:create_http_post_request).with(@uris[:post]).and_return(@request)