spec/embedly/api_spec.rb in embedly-1.8.0 vs spec/embedly/api_spec.rb in embedly-1.9.0
- old
+ new
@@ -39,8 +39,25 @@
it "sets the correct request adapter" do
api.request.should be_a(Embedly::Typhoeus::Request)
end
end
+
+ describe "faraday" do
+ before do
+ Embedly.configure { |c| c.request_with :faraday }
+ end
+
+ it "sets the correct request adapter" do
+ api.request.should be_a(Embedly::Request::Faraday)
+ end
+
+ it "calls faraday" do
+ url = 'http://example.com'
+ headers = {'User-Agent'=>'spec'}
+ Faraday.should_receive(:get).with(url, nil, headers)
+ api.request.get(URI.parse(url), headers: headers)
+ end
+ end
end
end
end