Sha256: 3586cde84367113779e8ff8433bd1ed069e3adbd4c0239e7bed78553456a6107
Contents?: true
Size: 585 Bytes
Versions: 11
Compression:
Stored size: 585 Bytes
Contents
require 'spec_helper' describe ButterCMS do describe '.request' do context 'with an api token' do before do ButterCMS.stub(:token).and_return('test123') end it 'should make an api request' do stub_request(:get, ButterCMS.endpoint).to_return(body: JSON.generate({data: {test: 'test'}})) expect{ ButterCMS.request('') }.to_not raise_error end end context 'without an api token' do it 'should throw an argument error' do expect{ ButterCMS.request() }.to raise_error(ArgumentError) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems