spreewald 2.7.0 → 2.7.1

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
  SHA256:
3
- metadata.gz: 02a43b32f16090f64a87cea6adc814baaceb590ef8388863224620f782565e25
4
- data.tar.gz: d474b73278a9b3c309c0898e83e1238715012f38cce70e3d8d13d77f9bcd8680
3
+ metadata.gz: ff2190f73eb0208f16e61464f60da6e726eac2423f39ad169f862fe2e9c01fb7
4
+ data.tar.gz: 149e2142c5f9df868ec19521dfb6404edcbc7267b99eabf0048bfb4a082c55d9
5
5
  SHA512:
6
- metadata.gz: c8c2ca98760710ddbda7a2aca39ec3208a1a01ab57e842a448dd14d5b3ba969834d6dc08638440e6979140f2fa22ef2ee152276ae2ae19363ef7294cad213cf5
7
- data.tar.gz: 9eea3e603ab1e9cb5d3346c948f09ee3b8c4bbfdd811b76eef3a0fc778c3015c48a85f97c31d6be8833f94e22d2d4ed159ab374b1aa345f51ffeba7d0f5fa23e
6
+ metadata.gz: 8141451a1da482256e7f9246c98e5e23bfb3f758854ee942c007fd59943165ae8802ff0dab9cf69b3c2c69225877f4c4dd8ba8ba457f304e8d2b3b805ddf06d2
7
+ data.tar.gz: beaa7a1eb91313d69a9a6f7d5aeecf580a38b65e0cd7ec1de19b6469ccda5f66c52a0e76f75bbe21a7596865f7458550591ed4540d82ce125fe3912816df07ad
@@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
5
5
 
6
+ ## 2.7.1
7
+ - Support RFC-compliant encoding of filenames in `Content-Disposition` header (e.g. send_data), as provided by Rails 6.
8
+
6
9
  ## 2.7.0
7
10
  - Add a step modifier to control different Capybara sessions: `... in the browser session "..."`. (see issue [#66](https://github.com/makandra/spreewald/issues/66))
8
11
 
@@ -463,7 +463,18 @@ end.overridable
463
463
  #
464
464
  # Attention: Doesn't work with Selenium, see https://github.com/jnicklas/capybara#gotchas
465
465
  Then /^I should get a download with filename "([^\"]*)"$/ do |filename|
466
- expect(page.response_headers['Content-Disposition']).to match /filename="#{Regexp.escape(filename)}"(;|$)/
466
+ content_disposition = page.response_headers['Content-Disposition']
467
+ expect(content_disposition).to be_present
468
+
469
+ fields = content_disposition.split(/;\s*/)
470
+
471
+ # Rails 6+ encodes filenames as defined in https://tools.ietf.org/html/rfc5987.
472
+ # If available, we prefer the UTF-8 filename.
473
+ download_filename = [/^filename\*=UTF-8''(.+)/, /^filename="(.+?)"/].each do |regexp|
474
+ matched_filename = fields.map { |field| field.scan(regexp).flatten.first }.compact.first
475
+ break CGI.unescape(matched_filename) if matched_filename
476
+ end
477
+ expect(download_filename).to eq(filename)
467
478
  end.overridable
468
479
 
469
480
  # Checks that a certain option is selected for a text field
@@ -1,3 +1,3 @@
1
1
  module Spreewald
2
- VERSION = '2.7.0'
2
+ VERSION = '2.7.1'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (2.7.0)
4
+ spreewald (2.7.1)
5
5
  cucumber
6
6
  cucumber_priority (>= 0.3.0)
7
7
  rspec (>= 2.13.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (2.7.0)
4
+ spreewald (2.7.1)
5
5
  cucumber
6
6
  cucumber_priority (>= 0.3.0)
7
7
  rspec (>= 2.13.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (2.7.0)
4
+ spreewald (2.7.1)
5
5
  cucumber
6
6
  cucumber_priority (>= 0.3.0)
7
7
  rspec (>= 2.13.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- spreewald (2.7.0)
4
+ spreewald (2.7.1)
5
5
  cucumber
6
6
  cucumber_priority (>= 0.3.0)
7
7
  rspec (>= 2.13.0)
@@ -1,7 +1,7 @@
1
1
  class DownloadsController < ApplicationController
2
2
 
3
3
  def spreadsheet
4
- send_data File.read("#{Rails.root}/public/fixture_files/spreadsheet.ods"), filename: 'test.ods'
4
+ send_data File.read("#{Rails.root}/public/fixture_files/spreadsheet.ods"), filename: 'test - example (today).ods'
5
5
  end
6
6
 
7
7
  end
@@ -290,7 +290,7 @@ Feature: Web steps
290
290
 
291
291
  Scenario: /^I should get a download with filename "([^\"]*)"$/
292
292
  When I go to "/downloads/spreadsheet"
293
- Then I should get a download with filename "test.ods"
293
+ Then I should get a download with filename "test - example (today).ods"
294
294
 
295
295
 
296
296
  Scenario: /^I should( not)? see a link labeled "([^"]*)"$/
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spreewald
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.0
4
+ version: 2.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Kraze
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-12 00:00:00.000000000 Z
11
+ date: 2020-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -410,7 +410,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
410
410
  - !ruby/object:Gem::Version
411
411
  version: '0'
412
412
  requirements: []
413
- rubygems_version: 3.1.2
413
+ rubygems_version: 3.0.3
414
414
  signing_key:
415
415
  specification_version: 4
416
416
  summary: Collection of useful cucumber steps.