Sha256: d236a294b4fc6a00260b130be6673a0d63ba7d175820deca4eb7cd865879cab1
Contents?: true
Size: 1002 Bytes
Versions: 1
Compression:
Stored size: 1002 Bytes
Contents
require_relative '../../../test_helper' module Troo module API describe Endpoints do let(:described_class) { Endpoints } describe '#interpolate' do let(:endpoint) { :board_by_id } let(:value) { { external_id: '20001' } } subject { described_class.interpolate(endpoint, value) } context 'when the endpoint exists' do it 'returns the interpolated endpoint' do subject.must_equal('/boards/20001') end context 'but the endpoint does not need interpolation' do let(:endpoint) { :boards_all } it 'returns the normal endpoint' do subject.must_equal('/members/me/boards') end end end context 'when the endpoint does not exist' do let(:endpoint) { :wrong_endpoint } it 'raises an exception' do proc { subject }.must_raise(Troo::EndpointNotFound) end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
troo-0.0.12 | test/lib/troo/api/endpoints_test.rb |