Sha256: bdad7541cadbc0ee0414c723078a6d2ea71b4574db38b033ad54ed618243fd50
Contents?: true
Size: 1.18 KB
Versions: 11
Compression:
Stored size: 1.18 KB
Contents
require 'spec_helper' describe FuelSDK::Targeting do subject { Class.new.new.extend(FuelSDK::Targeting) } it { should respond_to(:endpoint) } it { should_not respond_to(:endpoint=) } it { should respond_to(:determine_stack) } it { should respond_to(:get) } it { should respond_to(:post) } it { should respond_to(:patch) } it { should respond_to(:delete) } it { should respond_to(:access_token) } describe '#determine_stack' do let(:client) { c = Class.new.new.extend(FuelSDK::Targeting) c.stub(:access_token).and_return('open_sesame') c.stub(:get) .with('https://www.exacttargetapis.com/platform/v1/endpoints/soap',{'params'=>{'access_token'=>'open_sesame'}}) .and_return({'url' => 'S#.authentication.target'}) c } it 'sets @endpoint' do expect(client.send(:determine_stack)).to eq 'S#.authentication.target' end end describe '#endpoint' do let(:client) { c = Class.new.new.extend(FuelSDK::Targeting) c.stub(:get).and_return({'url' => 'S#.authentication.target'}) c } it 'calls determine_stack to find target' do expect(client.endpoint).to eq 'S#.authentication.target' end end end
Version data entries
11 entries across 11 versions & 2 rubygems