spec/api-client/base/post_spec.rb in api-client-1.0.0 vs spec/api-client/base/post_spec.rb in api-client-1.1.0
- old
+ new
@@ -4,10 +4,10 @@
let(:user) { User.new(:a => "a", :b => "b") }
describe "#post" do
context "when connection is refused" do
before :each do
- Net::HTTP.stub(:post_form).and_raise(Errno::ECONNREFUSED)
+ FakeWeb.register_uri(:post, "http://api.example.com/user/5", :exception => Errno::ECONNREFUSED)
end
it "should return a ConnectionRefused exception" do
lambda { ApiClient::Base.post('http://api.example.com/user/5', {}) }.should raise_error(ApiClient::Exceptions::ConnectionRefused)
end
\ No newline at end of file