spec/faraday/connection_spec.rb in faraday-1.4.2 vs spec/faraday/connection_spec.rb in faraday-1.4.3
- old
+ new
@@ -251,9 +251,16 @@
it 'handles uri instances' do
uri = conn.build_exclusive_url(URI('/sake.html'))
expect(uri.path).to eq('/sake.html')
end
+ it 'always returns new URI instance' do
+ conn.url_prefix = 'http://sushi.com'
+ uri1 = conn.build_exclusive_url(nil)
+ uri2 = conn.build_exclusive_url(nil)
+ expect(uri1).not_to equal(uri2)
+ end
+
context 'with url_prefixed connection' do
let(:url) { 'http://sushi.com/sushi/' }
it 'parses url and changes scheme' do
conn.scheme = 'https'