Sha256: c9be6d051649bc81ef7874e5eb22b82c40b5ae6a3ca08b27bc8bedfb48fa504e
Contents?: true
Size: 889 Bytes
Versions: 7
Compression:
Stored size: 889 Bytes
Contents
require "rails_helper" describe MnoEnterprise::ImpacClient do subject { MnoEnterprise::ImpacClient } let(:host_path) { "http://localhost:4000" } let(:params) { { sso_session: '1234' } } let(:endpoint) { "/some/endpoint" } let(:url) { "http://localhost:4000/some/endpoint?sso_session=1234" } describe ".host" do it { expect(subject.host).to eq(host_path) } end describe ".endpoint_url" do it { expect(subject.endpoint_url(endpoint, params)).to eq(url) } context "when the endpoint misses the first '/'" do let(:endpoint) { "some/endpoint" } it { expect(subject.endpoint_url(endpoint, params)).to eq(url) } end end describe ".send_get" do let(:opts) { {some: 'opts'} } before { allow(subject).to receive(:get).with(url, opts).and_return(true) } it { expect(subject.send_get(endpoint, params, opts)).to eq(true) } end end
Version data entries
7 entries across 7 versions & 1 rubygems