Sha256: 43babd684aed4e2d3c33bb1d9116cbfea85cd66482fb20a9f81a251c2be36128

Contents?: true

Size: 955 Bytes

Versions: 1

Compression:

Stored size: 955 Bytes

Contents

require 'spec_helper'

describe Enceladus::Requester do
  # Other requester methods are covered by other tests that fetch TMDb API resources, such as Movies, Cast, Genres, etc.
  describe "response parse error" do
    subject { Enceladus::Requester.get("/movie") }

    describe "malformed response" do
      before do
        stub_request(:get, /api.themoviedb.org\/movie/).to_return(status: 200, body: "")
      end

      it "should raise error Enceladus::Exception::JsonParseError" do
        expect{ subject }.to raise_error Enceladus::Exception::JsonParseError
      end
    end

    describe "SSLCertificateNotVerified" do
      before do
        allow(Enceladus::Requester).to receive(:get) { raise RestClient::SSLCertificateNotVerified, 'test' }
      end

      it "should re-raise the exception RestClient::SSLCertificateNotVerified" do
        expect{ subject }.to raise_error(RestClient::SSLCertificateNotVerified)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
enceladus-0.0.8 spec/enceladus/requester_spec.rb