Sha256: 171d73b228209e1c3cdd669758601a3428d6a4424684e0a35a9113490bf807ce
Contents?: true
Size: 1.06 KB
Versions: 34
Compression:
Stored size: 1.06 KB
Contents
require_relative '../spec_helper' describe RestfulResource::Base, 'authorization' do before :each do class FirstClient < RestfulResource::Base end class SecondClient < RestfulResource::Base end class NotConfiguredClient < RestfulResource::Base; end class FirstTest < FirstClient resource_path 'test' end class SecondTest < SecondClient resource_path 'test' end FirstClient.configure(base_url: 'http://api.carwow.co.uk/api/first') SecondClient.configure(base_url: 'http://api.carwow.co.uk/api/second', username: 'test_user', password: 'test_pass') end it "should use two different http instances" do expect(FirstTest.send(:http)).not_to equal(SecondTest.send(:http)) end it 'should have same http auth on superclass' do expect(SecondTest.send(:http)).to equal(SecondClient.send(:http)) end it 'should raise exception if base_url is not set' do expect { NotConfiguredClient.send(:base_url) }.to raise_error 'Base url missing' end end
Version data entries
34 entries across 34 versions & 1 rubygems