instapaper/spec/faraday/response_spec.rb
stve 6271356847 slight refactor in preparation for adding version 1.1 support
a couple breaking changes as part of this:

* the api version can no longer be set via configuration (since the API
itself now supports more than one version 1 and 1.1 this no longer makes
sense)
* removed module based support, all requests will require an Instapaper::Client from now on
* removed path_prefix configuration for same reasons that the api version was removed
2015-02-09 16:21:30 -05:00

22 lines
538 B
Ruby

require 'spec_helper'
describe Faraday::Response do
before do
@client = Instapaper::Client.new
end
[1040, 1041, 1042, 1220, 1221, 1240, 1241, 1242, 1243, 1244, 1245, 1250,
1251, 1252, 1500, 1550].each do |status|
context "when HTTP status is #{status}" do
before do
stub_post('/api/1/folders/list').to_return(status: status)
end
it 'should raise Instapaper::Error error' do
expect do
@client.folders
end.to raise_error(Instapaper::Error)
end
end
end
end