capybara 2.15.2 → 2.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4eb9fd96f4bd71cd4b6f610b7dae3d0b6da6fe21
4
- data.tar.gz: 615cf0e0fb68f9d6792338470bdd9dd277c4c673
3
+ metadata.gz: 900f8b3c6c40c11e73ea6b87c66f457f5dc31ba4
4
+ data.tar.gz: cc898006a411581c3496edf13da7beedca981972
5
5
  SHA512:
6
- metadata.gz: 48a0d0f5c133fbfd57a424410943830b1ce28cfe21784b4e085f9a2cfcf0f6bf207dca0cda824875a140aaf103d54c6e76ed3f821fe3700e33348bf1aaca9e22
7
- data.tar.gz: a9b0cbed365316d646d66cce8c11912631bd9c2214e90eea6d81ebec289cec5e5a66428a57a6e85d68ee936e1a9570193fc7982b85e5bb89ac5461812523d631
6
+ metadata.gz: 6a67ce2f18bd4995585b190df6483210f47782282df576d3e46655942f0ec23b962b52027a03fd97f4de48eefa73f931c3675a78388c6341b30c8394961771c0
7
+ data.tar.gz: '01017609801364f823592cf2a318264613d73e1b6b901e29ab78dbb88612e9694952f5172fa947b8ffc8cb48b9b0f2487768357b2ea81f939276bf53512ac043'
data/History.md CHANGED
@@ -1,3 +1,9 @@
1
+ # Version 2.15.3
2
+ Release date: Unreleased
3
+
4
+ ### Fixed
5
+ * Visiting '/' when Capybara.app_host has a trailing '/' - Issue #1918 [Thomas Walpole]
6
+
1
7
  # Version 2.15.2
2
8
  Release date: 2017-10-02
3
9
 
@@ -257,18 +257,19 @@ module Capybara
257
257
 
258
258
  uri_base.port ||= @server.port if @server && config.always_include_port
259
259
 
260
- # TODO - this is only for compatability with previous 2.x behavior that concatenated
261
- # Capybara.app_host and a "relative" path - Consider removing in 3.0
262
- # @abotalov brought up a good point about this behavior potentially being useful to people
263
- # deploying to a subdirectory and/or single page apps where only the url fragment changes
264
- if visit_uri.scheme.nil? && uri_base
265
- visit_uri.path = uri_base.path + visit_uri.path
266
- end
267
-
268
260
  if uri_base && [nil, 'http', 'https'].include?(visit_uri.scheme)
269
- visit_uri = uri_base.merge(visit_uri.to_hash.delete_if { |k,v| v.nil? })
270
- end
261
+ visit_uri_parts = visit_uri.to_hash.delete_if { |k,v| v.nil? }
262
+
263
+ if visit_uri.scheme.nil?
264
+ # TODO - this is only for compatability with previous 2.x behavior that concatenated
265
+ # Capybara.app_host and a "relative" path - Consider removing in 3.0
266
+ # @abotalov brought up a good point about this behavior potentially being useful to people
267
+ # deploying to a subdirectory and/or single page apps where only the url fragment changes
268
+ visit_uri_parts[:path] = uri_base.path + visit_uri.path
269
+ end
271
270
 
271
+ visit_uri = uri_base.merge(visit_uri_parts)
272
+ end
272
273
  driver.visit(visit_uri.to_s)
273
274
  end
274
275
 
@@ -113,8 +113,13 @@ Capybara::SpecHelper.spec '#visit' do
113
113
  @session.visit('/times')
114
114
  expect(@session).to have_content('redirection complete')
115
115
  end
116
- end
117
116
 
117
+ it "should work if `app_host` has a trailing /", requires: [:server] do
118
+ Capybara.app_host = "http://#{@session.server.host}:#{@session.server.port}/"
119
+ @session.visit('/')
120
+ expect(@session).to have_content('Hello world!')
121
+ end
122
+ end
118
123
 
119
124
  it "should send no referer when visiting a page" do
120
125
  @session.visit '/get_referer'
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Capybara
3
- VERSION = '2.15.2'
3
+ VERSION = '2.15.3'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.15.2
4
+ version: 2.15.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Walpole
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain:
12
12
  - gem-public_cert.pem
13
- date: 2017-10-02 00:00:00.000000000 Z
13
+ date: 2017-10-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri