cucumber-rails 2.4.0 → 2.5.0
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 +4 -4
- data/CHANGELOG.md +15 -3
- data/README.md +1 -1
- data/lib/cucumber/rails/capybara/select_dates_and_times.rb +28 -13
- data/lib/cucumber/rails/database/null_strategy.rb +15 -0
- data/lib/cucumber/rails/database.rb +2 -1
- data/lib/cucumber/rails.rb +1 -0
- data/lib/generators/cucumber/install_generator.rb +3 -3
- metadata +11 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e1cd2904e66669d6acf0468d21a4a3e28ac560bae247cf683f9c0e237e2cd11
|
4
|
+
data.tar.gz: 7edc69638a3946df0ac20707ce080c45361b8cab885171ba370191d84f5268b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eda48ea91bc84b2d3a4008dc8424c79e5ab3173dfaab739ed309f75619f8741899c12ba67c0d221be73aa6f052ebd7fe60e7cded149cfa4d4de19b59bfc3633e
|
7
|
+
data.tar.gz: 91f48677c021ad17c08b8a8fd50223c6942f7042ebfef1d68b3def47207cefecf73e45e5f955c881a3d180d9b8d821e87162bdd1dcaade16a702acbc66ed9bce
|
data/CHANGELOG.md
CHANGED
@@ -1,20 +1,32 @@
|
|
1
1
|
Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CONTRIBUTING.md)
|
2
2
|
on how to contribute to Cucumber.
|
3
3
|
|
4
|
-
## [main](https://github.com/cucumber/cucumber-rails/compare/v2.
|
4
|
+
## [main](https://github.com/cucumber/cucumber-rails/compare/v2.5.0...main) (Not yet released)
|
5
5
|
|
6
6
|
### New Features
|
7
7
|
|
8
|
-
|
8
|
+
|
9
9
|
|
10
10
|
### Changed
|
11
11
|
|
12
|
-
|
12
|
+
|
13
13
|
|
14
14
|
### Fixed
|
15
15
|
|
16
16
|
*
|
17
17
|
|
18
|
+
## [v2.5.0](https://github.com/cucumber/cucumber-rails/compare/v2.4.0...v2.5.0) (2022-03-07)
|
19
|
+
|
20
|
+
### New Features
|
21
|
+
|
22
|
+
* Added `:none` option for `javascript_strategy` which indicates no special handling of `@javascript` tagged tests ([#522](https://github.com/cucumber/cucumber-rails/pull/522) [akostadinov])
|
23
|
+
* Added support for Rails 7 ([#526](https://github.com/cucumber/cucumber-rails/pull/526/) [mgrunberg])
|
24
|
+
* Added Ruby 3.1 support ([#529](https://github.com/cucumber/cucumber-rails/pull/529) [mgrunberg])
|
25
|
+
|
26
|
+
### Changed
|
27
|
+
|
28
|
+
* Dropped Ruby 2.4 support ([#529](https://github.com/cucumber/cucumber-rails/pull/529) [mgrunberg])
|
29
|
+
|
18
30
|
## [v2.4.0](https://github.com/cucumber/cucumber-rails/compare/v2.3.0...v2.4.0) (2021-07-21)
|
19
31
|
|
20
32
|
### New Features
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
[](https://oselvar.com/github/cucumber/oselvar-github-metrics/main/cucumber/cucumber-rails)
|
8
8
|
[](https://oselvar.com/github/cucumber/oselvar-github-metrics/main/cucumber/cucumber-rails)
|
9
9
|
|
10
|
-
Cucumber-Rails brings Cucumber to Rails 5.x and
|
10
|
+
Cucumber-Rails brings Cucumber to Rails 5.x, 6.x and 7.x.
|
11
11
|
|
12
12
|
## Installation
|
13
13
|
|
@@ -7,27 +7,42 @@ module Cucumber
|
|
7
7
|
module SelectDatesAndTimes
|
8
8
|
# Select a Rails date. Options hash must include from: +label+
|
9
9
|
def select_date(date, options)
|
10
|
-
date
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
date = Date.parse(date)
|
11
|
+
if ::Rails::VERSION::MAJOR >= 7
|
12
|
+
# Rails 7 generates date fields using input type="date". Capybara support's them
|
13
|
+
fill_in options[:from], with: date
|
14
|
+
else
|
15
|
+
base_dom_id = get_base_dom_id_from_label_tag(options[:from])
|
16
|
+
|
17
|
+
find(:xpath, ".//select[@id='#{base_dom_id}_1i']").select(date.year.to_s)
|
18
|
+
find(:xpath, ".//select[@id='#{base_dom_id}_2i']").select(I18n.l(date, format: '%B'))
|
19
|
+
find(:xpath, ".//select[@id='#{base_dom_id}_3i']").select(date.day.to_s)
|
20
|
+
end
|
16
21
|
end
|
17
22
|
|
18
23
|
# Select a Rails time. Options hash must include from: +label+
|
19
24
|
def select_time(time, options)
|
20
|
-
time
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
+
time = Time.zone.parse(time)
|
26
|
+
if ::Rails::VERSION::MAJOR >= 7
|
27
|
+
# Rails 7 generates date fields using input type="time". Capybara support's them
|
28
|
+
fill_in options[:from], with: time
|
29
|
+
else
|
30
|
+
base_dom_id = get_base_dom_id_from_label_tag(options[:from])
|
31
|
+
|
32
|
+
find(:xpath, ".//select[@id='#{base_dom_id}_4i']").select(time.hour.to_s.rjust(2, '0'))
|
33
|
+
find(:xpath, ".//select[@id='#{base_dom_id}_5i']").select(time.min.to_s.rjust(2, '0'))
|
34
|
+
end
|
25
35
|
end
|
26
36
|
|
27
37
|
# Select a Rails datetime. Options hash must include from: +label+
|
28
38
|
def select_datetime(datetime, options)
|
29
|
-
|
30
|
-
|
39
|
+
if ::Rails::VERSION::MAJOR >= 7
|
40
|
+
# Rails 7 generates datetime fields using input type="datetime-local". Capybara support's them
|
41
|
+
fill_in options[:from], with: DateTime.parse(datetime)
|
42
|
+
else
|
43
|
+
select_date(datetime, options)
|
44
|
+
select_time(datetime, options)
|
45
|
+
end
|
31
46
|
end
|
32
47
|
|
33
48
|
private
|
data/lib/cucumber/rails.rb
CHANGED
@@ -24,6 +24,7 @@ if called_from_env_rb
|
|
24
24
|
require 'cucumber/rails/capybara'
|
25
25
|
require 'cucumber/rails/database/strategy'
|
26
26
|
require 'cucumber/rails/database/deletion_strategy'
|
27
|
+
require 'cucumber/rails/database/null_strategy'
|
27
28
|
require 'cucumber/rails/database/shared_connection_strategy'
|
28
29
|
require 'cucumber/rails/database/truncation_strategy'
|
29
30
|
require 'cucumber/rails/database'
|
@@ -61,15 +61,15 @@ module Cucumber
|
|
61
61
|
protected
|
62
62
|
|
63
63
|
def embed_file(source, indent = '')
|
64
|
-
|
64
|
+
File.read(File.join(self.class.source_root, source)).gsub(/^/, indent)
|
65
65
|
end
|
66
66
|
|
67
67
|
def embed_template(source, indent = '')
|
68
68
|
template = File.join(self.class.source_root, source)
|
69
69
|
if RUBY_VERSION >= '2.6'
|
70
|
-
ERB.new(
|
70
|
+
ERB.new(File.read(template), trim_mode: '-').result(binding).gsub(/^/, indent)
|
71
71
|
else
|
72
|
-
ERB.new(
|
72
|
+
ERB.new(File.read(template), nil, '-').result(binding).gsub(/^/, indent)
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aslak Hellesøy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2022-03-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: capybara
|
@@ -89,7 +89,7 @@ dependencies:
|
|
89
89
|
version: '5.0'
|
90
90
|
- - "<"
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version: '
|
92
|
+
version: '8'
|
93
93
|
type: :runtime
|
94
94
|
prerelease: false
|
95
95
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -99,7 +99,7 @@ dependencies:
|
|
99
99
|
version: '5.0'
|
100
100
|
- - "<"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
102
|
+
version: '8'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: rexml
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -238,14 +238,14 @@ dependencies:
|
|
238
238
|
requirements:
|
239
239
|
- - "~>"
|
240
240
|
- !ruby/object:Gem::Version
|
241
|
-
version: 1.
|
241
|
+
version: 1.24.0
|
242
242
|
type: :development
|
243
243
|
prerelease: false
|
244
244
|
version_requirements: !ruby/object:Gem::Requirement
|
245
245
|
requirements:
|
246
246
|
- - "~>"
|
247
247
|
- !ruby/object:Gem::Version
|
248
|
-
version: 1.
|
248
|
+
version: 1.24.0
|
249
249
|
- !ruby/object:Gem::Dependency
|
250
250
|
name: rubocop-packaging
|
251
251
|
requirement: !ruby/object:Gem::Requirement
|
@@ -348,6 +348,7 @@ files:
|
|
348
348
|
- lib/cucumber/rails/capybara/select_dates_and_times.rb
|
349
349
|
- lib/cucumber/rails/database.rb
|
350
350
|
- lib/cucumber/rails/database/deletion_strategy.rb
|
351
|
+
- lib/cucumber/rails/database/null_strategy.rb
|
351
352
|
- lib/cucumber/rails/database/shared_connection_strategy.rb
|
352
353
|
- lib/cucumber/rails/database/strategy.rb
|
353
354
|
- lib/cucumber/rails/database/truncation_strategy.rb
|
@@ -373,10 +374,10 @@ licenses:
|
|
373
374
|
- MIT
|
374
375
|
metadata:
|
375
376
|
bug_tracker_uri: https://github.com/cucumber/cucumber-rails/issues
|
376
|
-
changelog_uri: https://github.com/cucumber/cucumber-rails/blob/v2.
|
377
|
+
changelog_uri: https://github.com/cucumber/cucumber-rails/blob/v2.5.0/CHANGELOG.md
|
377
378
|
documentation_uri: https://cucumber.io/docs
|
378
379
|
mailing_list_uri: https://groups.google.com/forum/#!forum/cukes
|
379
|
-
source_code_uri: https://github.com/cucumber/cucumber-rails/tree/v2.
|
380
|
+
source_code_uri: https://github.com/cucumber/cucumber-rails/tree/v2.5.0
|
380
381
|
post_install_message:
|
381
382
|
rdoc_options: []
|
382
383
|
require_paths:
|
@@ -385,7 +386,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
385
386
|
requirements:
|
386
387
|
- - ">="
|
387
388
|
- !ruby/object:Gem::Version
|
388
|
-
version: 2.
|
389
|
+
version: 2.5.0
|
389
390
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
390
391
|
requirements:
|
391
392
|
- - ">="
|
@@ -395,5 +396,5 @@ requirements: []
|
|
395
396
|
rubygems_version: 3.1.2
|
396
397
|
signing_key:
|
397
398
|
specification_version: 4
|
398
|
-
summary: cucumber-rails-2.
|
399
|
+
summary: cucumber-rails-2.5.0
|
399
400
|
test_files: []
|