spreewald 2.7.0 → 2.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/spreewald/web_steps.rb +12 -1
- data/lib/spreewald_support/version.rb +1 -1
- data/tests/rails-3_capybara-1/Gemfile.lock +1 -1
- data/tests/rails-3_capybara-2/Gemfile.lock +1 -1
- data/tests/rails-4_capybara-3/Gemfile.lock +1 -1
- data/tests/rails-6_capybara-3/Gemfile.lock +1 -1
- data/tests/shared/app/controllers/downloads_controller.rb +1 -1
- data/tests/shared/features/shared/web_steps.feature +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff2190f73eb0208f16e61464f60da6e726eac2423f39ad169f862fe2e9c01fb7
|
4
|
+
data.tar.gz: 149e2142c5f9df868ec19521dfb6404edcbc7267b99eabf0048bfb4a082c55d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8141451a1da482256e7f9246c98e5e23bfb3f758854ee942c007fd59943165ae8802ff0dab9cf69b3c2c69225877f4c4dd8ba8ba457f304e8d2b3b805ddf06d2
|
7
|
+
data.tar.gz: beaa7a1eb91313d69a9a6f7d5aeecf580a38b65e0cd7ec1de19b6469ccda5f66c52a0e76f75bbe21a7596865f7458550591ed4540d82ce125fe3912816df07ad
|
data/CHANGELOG.md
CHANGED
@@ -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
|
|
data/lib/spreewald/web_steps.rb
CHANGED
@@ -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
|
-
|
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,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.
|
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
|
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.
|
413
|
+
rubygems_version: 3.0.3
|
414
414
|
signing_key:
|
415
415
|
specification_version: 4
|
416
416
|
summary: Collection of useful cucumber steps.
|