Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package rubygem-rspec-rails for
openSUSE:Factory checked in at 2022-10-30 18:28:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-rspec-rails (Old)
and /work/SRC/openSUSE:Factory/.rubygem-rspec-rails.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-rspec-rails"
Sun Oct 30 18:28:58 2022 rev:10 rq:1032158 version:6.0.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-rspec-rails/rubygem-rspec-rails.changes
2022-04-30 22:52:59.876261602 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-rspec-rails.new.2275/rubygem-rspec-rails.changes
2022-10-30 18:29:16.186525025 +0100
@@ -1,0 +2,7 @@
+Fri Oct 28 05:05:55 UTC 2022 - Stephan Kulow <[email protected]>
+
+updated to version 6.0.1
+ see installed Changelog.md
+
+
+-------------------------------------------------------------------
Old:
----
rspec-rails-5.1.2.gem
New:
----
rspec-rails-6.0.1.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-rspec-rails.spec ++++++
--- /var/tmp/diff_new_pack.GX66Tu/_old 2022-10-30 18:29:16.630527425 +0100
+++ /var/tmp/diff_new_pack.GX66Tu/_new 2022-10-30 18:29:16.634527446 +0100
@@ -24,12 +24,12 @@
#
Name: rubygem-rspec-rails
-Version: 5.1.2
+Version: 6.0.1
Release: 0
%define mod_name rspec-rails
%define mod_full_name %{mod_name}-%{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: %{ruby >= 2.2.0}
+BuildRequires: %{ruby >= 2.5.0}
BuildRequires: %{rubygem gem2rpm}
BuildRequires: %{rubygem rdoc > 3.10}
BuildRequires: ruby-macros >= 5
++++++ rspec-rails-5.1.2.gem -> rspec-rails-6.0.1.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Changelog.md new/Changelog.md
--- old/Changelog.md 2022-04-24 10:27:57.000000000 +0200
+++ new/Changelog.md 2022-10-18 10:12:58.000000000 +0200
@@ -1,5 +1,37 @@
### Development
-[Full
Changelog](https://github.com/rspec/rspec-rails/compare/v5.1.1...5-1-maintenance)
+[Full
Changelog](https://github.com/rspec/rspec-rails/compare/v6.0.0...6-0-maintenance)
+
+### 6.0.1 / 2022-10-18
+[Full Changelog](https://github.com/rspec/rspec-rails/compare/v6.0.0...6.0.1)
+
+Bug Fixes:
+
+* Prevent tagged logged support in Rails 7 calling `#name`. (Jon Rowe, #2625)
+
+### 6.0.0 / 2022-10-10
+[Full Changelog](https://github.com/rspec/rspec-rails/compare/v5.1.2...6.0.0)
+
+Enhancements:
+
+* Support Rails 7
+* Template tweaks to remove instance variables from generated specs. (Takuma
Ishikawa, #2599)
+* Generators now respects default path configuration option. (@vivekmiyani,
#2508)
+
+Breaking Changes:
+
+* Drop support for Rails below 6.1
+* Drop support for Ruby below 2.5 (following supported versions of Rails 6.1)
+* Change the order of `after_teardown` from `after` to `around` in system
+ specs to improve compatibility with extensions and Capybara. (Tim Diggins,
#2596)
+
+Deprecations:
+
+* Deprecates integration spec generator (`rspec:integration`)
+ which was an alias of request spec generator (`rspec:request`)
+ (Luka L??dicke, #2374)
+
+### 5.1.2 / 2022-04-24
+[Full Changelog](https://github.com/rspec/rspec-rails/compare/v5.1.1...v5.1.2)
Bug Fixes:
@@ -31,8 +63,9 @@
* Properly name params in controller and request spec templates when
using the `--model-name` parameter. (@kenzo-tanaka, #2534)
-* Fix support for `have_enqueued_mail` on Ruby 3.1 with Rails 6.1.
- (Fabio Napoleoni, Mikael Henriksson, Phil Pirozhkov, Jon Rowe, #2566)
+* Fix parameter matching with mail delivery job and
+ ActionMailer::MailDeliveryJob. (Fabio Napoleoni, #2516, #2546)
+* Fix Rails 7 `have_enqueued_mail` compatibility (Mikael Henriksson, #2537,
#2546)
### 5.0.2 / 2021-08-14
[Full Changelog](https://github.com/rspec/rspec-rails/compare/v5.0.1...v5.0.2)
@@ -78,7 +111,7 @@
Enhancements:
-* Issue a warning when using job matchers with `#at` mis-match on `usec`
precision.
+* Issue a warning when using job matchers with `#at` mismatch on `usec`
precision.
(Jon Rowe, #2350)
* Generated request specs now have a bare `_spec` suffix instead of
`request_spec`.
(Eloy Espinaco, Luka L??dicke, #2355, #2356, #2378)
@@ -205,7 +238,7 @@
Bug Fixes:
-* Namespaced fixtures now generate a `/` seperated path rather than an `_`.
+* Namespaced fixtures now generate a `/` separated path rather than an `_`.
(@nxlith, #2077)
* Check the arity of `errors` before attempting to use it to generate the
`be_valid`
error message. (Kevin Kuchta, #2096)
@@ -365,7 +398,7 @@
Bug fixes:
-* Prevent asset helpers from taking precendence over route helpers. (Prem
Sichanugrist, #1496)
+* Prevent asset helpers from taking precedence over route helpers. (Prem
Sichanugrist, #1496)
* Prevent `NoMethodError` during failed `have_rendered` assertions on weird
templates.
(Jon Rowe, #1623).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2022-04-24 10:27:57.000000000 +0200
+++ new/README.md 2022-10-18 10:12:58.000000000 +0200
@@ -9,7 +9,8 @@
expressed in plain English.
According to [RSpec Rails new versioning strategy][] use:
-* **[`rspec-rails` 5.x][]** for Rails 6.x.
+* **[`rspec-rails` 6.x][]** for Rails 6.1 or 7.x.
+* **[`rspec-rails` 5.x][]** for Rails 5.2 or 6.x.
* **[`rspec-rails` 4.x][]** for Rails from 5.x or 6.x.
* **[`rspec-rails` 3.x][]** for Rails earlier than 5.0.
* **[`rspec-rails` 1.x][]** for Rails 2.x.
@@ -25,13 +26,14 @@
[`rspec-rails` 1.x]: https://github.com/dchelimsky/rspec-rails
[`rspec-rails` 3.x]: https://github.com/rspec/rspec-rails/tree/3-9-maintenance
[`rspec-rails` 4.x]: https://github.com/rspec/rspec-rails/tree/4-1-maintenance
-[`rspec-rails` 5.x]: https://github.com/rspec/rspec-rails/tree/5-0-maintenance
+[`rspec-rails` 5.x]: https://github.com/rspec/rspec-rails/tree/5-1-maintenance
+[`rspec-rails` 6.x]: https://github.com/rspec/rspec-rails/tree/6-0-maintenance
[RSpec Rails new versioning strategy]:
https://github.com/rspec/rspec-rails/blob/main/rfcs/versioning-strategy.md
## Installation
**IMPORTANT** This README / branch refers to the current development build.
-See the [`5-0-maintenance` branch on
Github](https://github.com/rspec/rspec-rails/tree/5-0-maintenance) if you want
or require the latest stable release.
+See the [`6-0-maintenance` branch on
Github](https://github.com/rspec/rspec-rails/tree/6-0-maintenance) if you want
or require the latest stable release.
1. Add `rspec-rails` to **both** the `:development` and `:test` groups
of your app???s `Gemfile`:
@@ -39,7 +41,7 @@
```ruby
# Run against this stable release
group :development, :test do
- gem 'rspec-rails', '~> 5.0.0'
+ gem 'rspec-rails', '~> 6.0.0'
end
# Or, run against the main branch
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
Binary files old/checksums.yaml.gz.sig and new/checksums.yaml.gz.sig differ
Binary files old/data.tar.gz.sig and new/data.tar.gz.sig differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/generators/rspec/channel/channel_generator.rb
new/lib/generators/rspec/channel/channel_generator.rb
--- old/lib/generators/rspec/channel/channel_generator.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/generators/rspec/channel/channel_generator.rb 2022-10-18
10:12:58.000000000 +0200
@@ -5,7 +5,7 @@
# @private
class ChannelGenerator < Base
def create_channel_spec
- template 'channel_spec.rb.erb', File.join('spec/channels', class_path,
"#{file_name}_channel_spec.rb")
+ template 'channel_spec.rb.erb', target_path('channels', class_path,
"#{file_name}_channel_spec.rb")
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lib/generators/rspec/controller/controller_generator.rb
new/lib/generators/rspec/controller/controller_generator.rb
--- old/lib/generators/rspec/controller/controller_generator.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/generators/rspec/controller/controller_generator.rb 2022-10-18
10:12:58.000000000 +0200
@@ -16,14 +16,14 @@
return unless options[:request_specs]
template 'request_spec.rb',
- File.join('spec/requests', class_path, "#{file_name}_spec.rb")
+ target_path('requests', class_path, "#{file_name}_spec.rb")
end
def generate_controller_spec
return unless options[:controller_specs]
template 'controller_spec.rb',
- File.join('spec/controllers', class_path,
"#{file_name}_controller_spec.rb")
+ target_path('controllers', class_path,
"#{file_name}_controller_spec.rb")
end
def generate_view_specs
@@ -35,7 +35,7 @@
actions.each do |action|
@action = action
template 'view_spec.rb',
- File.join("spec", "views", file_path,
"#{@action}.html.#{options[:template_engine]}_spec.rb")
+ target_path('views', file_path,
"#{@action}.html.#{options[:template_engine]}_spec.rb")
end
end
@@ -44,7 +44,7 @@
return unless options[:routing_specs]
template 'routing_spec.rb',
- File.join('spec/routing', class_path,
"#{file_name}_routing_spec.rb")
+ target_path('routing', class_path,
"#{file_name}_routing_spec.rb")
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/generators/rspec/feature/feature_generator.rb
new/lib/generators/rspec/feature/feature_generator.rb
--- old/lib/generators/rspec/feature/feature_generator.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/generators/rspec/feature/feature_generator.rb 2022-10-18
10:12:58.000000000 +0200
@@ -10,7 +10,7 @@
def generate_feature_spec
return unless options[:feature_specs]
- template template_name, File.join('spec/features', class_path,
filename)
+ template template_name, target_path('features', class_path, filename)
end
def template_name
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lib/generators/rspec/generator/generator_generator.rb
new/lib/generators/rspec/generator/generator_generator.rb
--- old/lib/generators/rspec/generator/generator_generator.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/generators/rspec/generator/generator_generator.rb 2022-10-18
10:12:58.000000000 +0200
@@ -9,7 +9,7 @@
def generate_generator_spec
return unless options[:generator_specs]
- template template_name, File.join('spec/generator', class_path,
filename)
+ template template_name, target_path('generator', class_path, filename)
end
def template_name
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/generators/rspec/helper/helper_generator.rb
new/lib/generators/rspec/helper/helper_generator.rb
--- old/lib/generators/rspec/helper/helper_generator.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/generators/rspec/helper/helper_generator.rb 2022-10-18
10:12:58.000000000 +0200
@@ -9,7 +9,7 @@
def generate_helper_spec
return unless options[:helper_specs]
- template 'helper_spec.rb', File.join('spec/helpers', class_path,
"#{file_name}_helper_spec.rb")
+ template 'helper_spec.rb', target_path('helpers', class_path,
"#{file_name}_helper_spec.rb")
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/generators/rspec/install/install_generator.rb
new/lib/generators/rspec/install/install_generator.rb
--- old/lib/generators/rspec/install/install_generator.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/generators/rspec/install/install_generator.rb 2022-10-18
10:12:58.000000000 +0200
@@ -12,6 +12,8 @@
Copy rspec files to your application.
DESC
+ class_option :default_path, type: :string, default: 'spec'
+
def self.source_root
@source_root ||= File.expand_path(File.join(File.dirname(__FILE__),
'templates'))
end
@@ -20,12 +22,12 @@
Dir.mktmpdir do |dir|
generate_rspec_init dir
template File.join(dir, '.rspec'), '.rspec'
- directory File.join(dir, 'spec'), 'spec'
+ directory File.join(dir, 'spec'), default_path
end
end
def copy_rails_files
- template 'spec/rails_helper.rb'
+ template 'spec/rails_helper.rb', "#{default_path}/rails_helper.rb"
end
private
@@ -41,6 +43,12 @@
replace_generator_command(spec_helper_path)
remove_warnings_configuration(spec_helper_path)
+
+ unless default_path == "spec"
+ dot_rspec_path = File.join(tmpdir, '.rspec')
+
+ append_default_path(dot_rspec_path)
+ end
end
def replace_generator_command(spec_helper_path)
@@ -58,6 +66,15 @@
'',
verbose: false
end
+
+ def append_default_path(dot_rspec_path)
+ append_to_file dot_rspec_path,
+ "--default-path #{default_path}"
+ end
+
+ def default_path
+ options[:default_path]
+ end
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lib/generators/rspec/install/templates/spec/rails_helper.rb
new/lib/generators/rspec/install/templates/spec/rails_helper.rb
--- old/lib/generators/rspec/install/templates/spec/rails_helper.rb
2022-04-24 10:27:57.000000000 +0200
+++ new/lib/generators/rspec/install/templates/spec/rails_helper.rb
2022-10-18 10:12:58.000000000 +0200
@@ -28,8 +28,7 @@
begin
ActiveRecord::Migration.maintain_test_schema!
rescue ActiveRecord::PendingMigrationError => e
- puts e.to_s.strip
- exit 1
+ abort e.to_s.strip
end
<% end -%>
RSpec.configure do |config|
@@ -49,7 +48,7 @@
# Remove this line to enable support for ActiveRecord
config.use_active_record = false
- # If you enable ActiveRecord support you should unncomment these lines,
+ # If you enable ActiveRecord support you should uncomment these lines,
# note if you'd prefer not to run each example within a transaction, you
# should set use_transactional_fixtures to false.
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lib/generators/rspec/integration/integration_generator.rb
new/lib/generators/rspec/integration/integration_generator.rb
--- old/lib/generators/rspec/integration/integration_generator.rb
2022-04-24 10:27:57.000000000 +0200
+++ new/lib/generators/rspec/integration/integration_generator.rb
2022-10-18 10:12:58.000000000 +0200
@@ -1,21 +1,28 @@
require 'generators/rspec'
+require 'rspec/core/warnings'
module Rspec
module Generators
# @private
class IntegrationGenerator < Base
- # Add a deprecation for this class, before rspec-rails 4, to use the
- # `RequestGenerator` instead
class_option :request_specs,
type: :boolean,
default: true,
desc: "Generate request specs"
+ source_paths << File.expand_path('../request/templates', __dir__)
+
def generate_request_spec
return unless options[:request_specs]
+ RSpec.warn_deprecation <<-WARNING.gsub(/\s*\|/, ' ')
+ |The integration generator is deprecated
+ |and will be deleted in RSpec-Rails 7.
+ |Please use the request generator instead.
+ WARNING
+
template 'request_spec.rb',
- File.join('spec/requests',
"#{name.underscore.pluralize}_spec.rb")
+ target_path('requests',
"#{name.underscore.pluralize}_spec.rb")
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lib/generators/rspec/integration/templates/request_spec.rb
new/lib/generators/rspec/integration/templates/request_spec.rb
--- old/lib/generators/rspec/integration/templates/request_spec.rb
2022-04-24 10:27:57.000000000 +0200
+++ new/lib/generators/rspec/integration/templates/request_spec.rb
1970-01-01 01:00:00.000000000 +0100
@@ -1,10 +0,0 @@
-require 'rails_helper'
-
-RSpec.describe "<%= class_name.pluralize %>", <%= type_metatag(:request) %> do
- describe "GET /<%= name.underscore.pluralize %>" do
- it "works! (now write some real specs)" do
- get <%= index_helper %>_path
- expect(response).to have_http_status(200)
- end
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/generators/rspec/job/job_generator.rb
new/lib/generators/rspec/job/job_generator.rb
--- old/lib/generators/rspec/job/job_generator.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/generators/rspec/job/job_generator.rb 2022-10-18
10:12:58.000000000 +0200
@@ -6,7 +6,7 @@
class JobGenerator < Base
def create_job_spec
file_suffix = file_name.end_with?('job') ? 'spec.rb' : 'job_spec.rb'
- template 'job_spec.rb.erb', File.join('spec/jobs', class_path,
[file_name, file_suffix].join('_'))
+ template 'job_spec.rb.erb', target_path('jobs', class_path,
[file_name, file_suffix].join('_'))
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/generators/rspec/mailbox/mailbox_generator.rb
new/lib/generators/rspec/mailbox/mailbox_generator.rb
--- old/lib/generators/rspec/mailbox/mailbox_generator.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/generators/rspec/mailbox/mailbox_generator.rb 2022-10-18
10:12:58.000000000 +0200
@@ -6,7 +6,7 @@
class MailboxGenerator < Base
def create_mailbox_spec
template('mailbox_spec.rb.erb',
- File.join('spec/mailboxes', class_path,
"#{file_name}_mailbox_spec.rb")
+ target_path('mailboxes', class_path,
"#{file_name}_mailbox_spec.rb")
)
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/generators/rspec/mailer/mailer_generator.rb
new/lib/generators/rspec/mailer/mailer_generator.rb
--- old/lib/generators/rspec/mailer/mailer_generator.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/generators/rspec/mailer/mailer_generator.rb 2022-10-18
10:12:58.000000000 +0200
@@ -8,20 +8,20 @@
argument :actions, type: :array, default: [], banner: "method method"
def generate_mailer_spec
- template "mailer_spec.rb", File.join('spec/mailers', class_path,
"#{file_name}_spec.rb")
+ template "mailer_spec.rb", target_path('mailers', class_path,
"#{file_name}_spec.rb")
end
def generate_fixtures_files
actions.each do |action|
@action, @path = action, File.join(file_path, action)
- template "fixture", File.join("spec/fixtures", @path)
+ template "fixture", target_path("fixtures", @path)
end
end
def generate_preview_files
return unless RSpec::Rails::FeatureCheck.has_action_mailer_preview?
- template "preview.rb", File.join("spec/mailers/previews", class_path,
"#{file_name}_preview.rb")
+ template "preview.rb", target_path("mailers/previews", class_path,
"#{file_name}_preview.rb")
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/generators/rspec/model/model_generator.rb
new/lib/generators/rspec/model/model_generator.rb
--- old/lib/generators/rspec/model/model_generator.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/generators/rspec/model/model_generator.rb 2022-10-18
10:12:58.000000000 +0200
@@ -11,8 +11,8 @@
class_option :fixture, type: :boolean
def create_model_spec
- template_file = File.join(
- 'spec/models',
+ template_file = target_path(
+ 'models',
class_path,
"#{file_name}_spec.rb"
)
@@ -24,7 +24,7 @@
def create_fixture_file
return unless missing_fixture_replacement?
- template 'fixtures.yml', File.join('spec/fixtures', class_path,
"#{(pluralize_table_names? ? plural_file_name : file_name)}.yml")
+ template 'fixtures.yml', target_path('fixtures', class_path,
"#{(pluralize_table_names? ? plural_file_name : file_name)}.yml")
end
private
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/generators/rspec/request/request_generator.rb
new/lib/generators/rspec/request/request_generator.rb
--- old/lib/generators/rspec/request/request_generator.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/generators/rspec/request/request_generator.rb 2022-10-18
10:12:58.000000000 +0200
@@ -1,10 +1,17 @@
-require 'generators/rspec/integration/integration_generator'
+require 'generators/rspec'
module Rspec
module Generators
# @private
- class RequestGenerator < IntegrationGenerator
- source_paths << File.expand_path('../integration/templates', __dir__)
+ class RequestGenerator < Base
+ class_option :request_specs, type: :boolean, default: true, desc:
'Generate request specs'
+
+ def generate_request_spec
+ return unless options[:request_specs]
+
+ template 'request_spec.rb',
+ target_path('requests',
"#{name.underscore.pluralize}_spec.rb")
+ end
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lib/generators/rspec/request/templates/request_spec.rb
new/lib/generators/rspec/request/templates/request_spec.rb
--- old/lib/generators/rspec/request/templates/request_spec.rb 1970-01-01
01:00:00.000000000 +0100
+++ new/lib/generators/rspec/request/templates/request_spec.rb 2022-10-18
10:12:58.000000000 +0200
@@ -0,0 +1,10 @@
+require 'rails_helper'
+
+RSpec.describe "<%= class_name.pluralize %>", <%= type_metatag(:request) %> do
+ describe "GET /<%= name.underscore.pluralize %>" do
+ it "works! (now write some real specs)" do
+ get <%= index_helper %>_path
+ expect(response).to have_http_status(200)
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/generators/rspec/scaffold/scaffold_generator.rb
new/lib/generators/rspec/scaffold/scaffold_generator.rb
--- old/lib/generators/rspec/scaffold/scaffold_generator.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/generators/rspec/scaffold/scaffold_generator.rb 2022-10-18
10:12:58.000000000 +0200
@@ -58,8 +58,8 @@
def generate_routing_spec
return unless options[:routing_specs]
- template_file = File.join(
- 'spec/routing',
+ template_file = target_path(
+ 'routing',
controller_class_path,
"#{controller_file_name}_routing_spec.rb"
)
@@ -72,7 +72,7 @@
def copy_view(view)
template "#{view}_spec.rb",
- File.join("spec/views", controller_file_path,
"#{view}.html.#{options[:template_engine]}_spec.rb")
+ target_path("views", controller_file_path,
"#{view}.html.#{options[:template_engine]}_spec.rb")
end
# support for namespaced-resources
@@ -121,7 +121,7 @@
end
def template_file(folder:, suffix: '')
- File.join('spec', folder, controller_class_path,
"#{controller_file_name}#{suffix}_spec.rb")
+ target_path(folder, controller_class_path,
"#{controller_file_name}#{suffix}_spec.rb")
end
def banner
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lib/generators/rspec/scaffold/templates/controller_spec.rb
new/lib/generators/rspec/scaffold/templates/controller_spec.rb
--- old/lib/generators/rspec/scaffold/templates/controller_spec.rb
2022-04-24 10:27:57.000000000 +0200
+++ new/lib/generators/rspec/scaffold/templates/controller_spec.rb
2022-10-18 10:12:58.000000000 +0200
@@ -90,10 +90,17 @@
end
context "with invalid params" do
+ <% if Rails.version.to_f < 7.0 %>
it "returns a success response (i.e. to display the 'new' template)" do
post :create, params: {<%= singular_table_name %>:
invalid_attributes}, session: valid_session
expect(response).to be_successful
end
+ <% else %>
+ it "renders a response with 422 status (i.e. to display the 'new'
template)" do
+ post :create, params: {<%= singular_table_name %>:
invalid_attributes}, session: valid_session
+ expect(response).to have_http_status(:unprocessable_entity)
+ end
+ <% end %>
end
end
@@ -118,11 +125,19 @@
end
context "with invalid params" do
+ <% if Rails.version.to_f < 7.0 %>
it "returns a success response (i.e. to display the 'edit' template)" do
<%= file_name %> = <%= class_name %>.create! valid_attributes
put :update, params: {id: <%= file_name %>.to_param, <%=
singular_table_name %>: invalid_attributes}, session: valid_session
expect(response).to be_successful
end
+ <% else %>
+ it "renders a response with 422 status (i.e. to display the 'edit'
template)" do
+ <%= file_name %> = <%= class_name %>.create! valid_attributes
+ put :update, params: {id: <%= file_name %>.to_param, <%=
singular_table_name %>: invalid_attributes}, session: valid_session
+ expect(response).to have_http_status(:unprocessable_entity)
+ end
+ <% end %>
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/generators/rspec/scaffold/templates/edit_spec.rb
new/lib/generators/rspec/scaffold/templates/edit_spec.rb
--- old/lib/generators/rspec/scaffold/templates/edit_spec.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/generators/rspec/scaffold/templates/edit_spec.rb 2022-10-18
10:12:58.000000000 +0200
@@ -2,18 +2,22 @@
<% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp,
:time, :date].index(attribute.type) } -%>
RSpec.describe "<%= ns_table_name %>/edit", <%= type_metatag(:view) %> do
- before(:each) do
- @<%= ns_file_name %> = assign(:<%= ns_file_name %>, <%= class_name
%>.create!(<%= '))' if output_attributes.empty? %>
+ let(:<%= ns_file_name %>) {
+ <%= class_name %>.create!(<%= ')' if output_attributes.empty? %>
<% output_attributes.each_with_index do |attribute, attribute_index| -%>
<%= attribute.name %>: <%= attribute.default.inspect %><%=
attribute_index == output_attributes.length - 1 ? '' : ','%>
<% end -%>
-<%= output_attributes.empty? ? "" : " ))\n" -%>
+<%= " )\n" unless output_attributes.empty? -%>
+ }
+
+ before(:each) do
+ assign(:<%= ns_file_name %>, <%= ns_file_name %>)
end
it "renders the edit <%= ns_file_name %> form" do
render
- assert_select "form[action=?][method=?]", <%= ns_file_name %>_path(@<%=
ns_file_name %>), "post" do
+ assert_select "form[action=?][method=?]", <%= ns_file_name %>_path(<%=
ns_file_name %>), "post" do
<% for attribute in output_attributes -%>
<%- name = attribute.respond_to?(:column_name) ? attribute.column_name :
attribute.name %>
assert_select "<%= attribute.input_type -%>[name=?]", "<%= ns_file_name
%>[<%= name %>]"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lib/generators/rspec/scaffold/templates/index_spec.rb
new/lib/generators/rspec/scaffold/templates/index_spec.rb
--- old/lib/generators/rspec/scaffold/templates/index_spec.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/generators/rspec/scaffold/templates/index_spec.rb 2022-10-18
10:12:58.000000000 +0200
@@ -18,8 +18,9 @@
it "renders a list of <%= ns_table_name %>" do
render
+ cell_selector = Rails::VERSION::STRING >= '7' ? 'div>p' : 'tr>td'
<% for attribute in output_attributes -%>
- assert_select "tr>td", text: <%= value_for(attribute) %>.to_s, count: 2
+ assert_select cell_selector, text: Regexp.new(<%= value_for(attribute)
%>.to_s), count: 2
<% end -%>
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lib/generators/rspec/scaffold/templates/request_spec.rb
new/lib/generators/rspec/scaffold/templates/request_spec.rb
--- old/lib/generators/rspec/scaffold/templates/request_spec.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/generators/rspec/scaffold/templates/request_spec.rb 2022-10-18
10:12:58.000000000 +0200
@@ -83,10 +83,17 @@
}.to change(<%= class_name %>, :count).by(0)
end
+ <% if Rails.version.to_f < 7.0 %>
it "renders a successful response (i.e. to display the 'new' template)"
do
post <%= index_helper %>_url, params: { <%= singular_table_name %>:
invalid_attributes }
expect(response).to be_successful
end
+ <% else %>
+ it "renders a response with 422 status (i.e. to display the 'new'
template)" do
+ post <%= index_helper %>_url, params: { <%= singular_table_name %>:
invalid_attributes }
+ expect(response).to have_http_status(:unprocessable_entity)
+ end
+ <% end %>
end
end
@@ -112,11 +119,19 @@
end
context "with invalid parameters" do
+ <% if Rails.version.to_f < 7.0 %>
it "renders a successful response (i.e. to display the 'edit' template)"
do
<%= file_name %> = <%= class_name %>.create! valid_attributes
patch <%= show_helper %>, params: { <%= singular_table_name %>:
invalid_attributes }
expect(response).to be_successful
end
+ <% else %>
+ it "renders a response with 422 status (i.e. to display the 'edit'
template)" do
+ <%= file_name %> = <%= class_name %>.create! valid_attributes
+ patch <%= show_helper %>, params: { <%= singular_table_name %>:
invalid_attributes }
+ expect(response).to have_http_status(:unprocessable_entity)
+ end
+ <% end %>
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/generators/rspec/scaffold/templates/show_spec.rb
new/lib/generators/rspec/scaffold/templates/show_spec.rb
--- old/lib/generators/rspec/scaffold/templates/show_spec.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/generators/rspec/scaffold/templates/show_spec.rb 2022-10-18
10:12:58.000000000 +0200
@@ -3,7 +3,7 @@
<% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp,
:time, :date].index(attribute.type) } -%>
RSpec.describe "<%= ns_table_name %>/show", <%= type_metatag(:view) %> do
before(:each) do
- @<%= ns_file_name %> = assign(:<%= ns_file_name %>, <%= class_name
%>.create!(<%= '))' if output_attributes.empty? %>
+ assign(:<%= ns_file_name %>, <%= class_name %>.create!(<%= '))' if
output_attributes.empty? %>
<% output_attributes.each_with_index do |attribute, attribute_index| -%>
<%= attribute.name %>: <%= value_for(attribute) %><%= attribute_index ==
output_attributes.length - 1 ? '' : ','%>
<% end -%>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/generators/rspec/system/system_generator.rb
new/lib/generators/rspec/system/system_generator.rb
--- old/lib/generators/rspec/system/system_generator.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/generators/rspec/system/system_generator.rb 2022-10-18
10:12:58.000000000 +0200
@@ -9,7 +9,7 @@
def generate_system_spec
return unless options[:system_specs]
- template template_name, File.join('spec/system', class_path, filename)
+ template template_name, target_path('system', class_path, filename)
end
def template_name
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/generators/rspec/view/view_generator.rb
new/lib/generators/rspec/view/view_generator.rb
--- old/lib/generators/rspec/view/view_generator.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/generators/rspec/view/view_generator.rb 2022-10-18
10:12:58.000000000 +0200
@@ -9,12 +9,12 @@
class_option :template_engine, desc: "Template engine to generate view
files"
def create_view_specs
- empty_directory File.join("spec", "views", file_path)
+ empty_directory target_path("views", file_path)
actions.each do |action|
@action = action
template 'view_spec.rb',
- File.join("spec", "views", file_path,
"#{@action}.html.#{options[:template_engine]}_spec.rb")
+ target_path("views", file_path,
"#{@action}.html.#{options[:template_engine]}_spec.rb")
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/generators/rspec.rb new/lib/generators/rspec.rb
--- old/lib/generators/rspec.rb 2022-04-24 10:27:57.000000000 +0200
+++ new/lib/generators/rspec.rb 2022-10-18 10:12:58.000000000 +0200
@@ -1,8 +1,9 @@
require 'rails/generators/named_base'
+require 'rspec/core'
require 'rspec/rails/feature_check'
# @private
-# Weirdly named generators namespace (should be `RSpec`) for compatability with
+# Weirdly named generators namespace (should be `RSpec`) for compatibility with
# rails loading.
module Rspec
# @private
@@ -18,6 +19,22 @@
@_rspec_source_root ||=
File.expand_path(File.join(File.dirname(__FILE__), 'rspec', generator_name,
'templates'))
end
end
+
+ # @private
+ # Load configuration from RSpec to ensure `--default-path` is set
+ def self.configuration
+ @configuration ||=
+ begin
+ configuration = RSpec.configuration
+ options = RSpec::Core::ConfigurationOptions.new({})
+ options.configure(configuration)
+ configuration
+ end
+ end
+
+ def target_path(*paths)
+ File.join(self.class.configuration.default_path, *paths)
+ end
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/rails/adapters.rb
new/lib/rspec/rails/adapters.rb
--- old/lib/rspec/rails/adapters.rb 2022-04-24 10:27:57.000000000 +0200
+++ new/lib/rspec/rails/adapters.rb 2022-10-18 10:12:58.000000000 +0200
@@ -181,5 +181,16 @@
#
# @private
TestUnitAssertionAdapter = MinitestAssertionAdapter
+
+ # @private
+ module TaggedLoggingAdapter
+ private
+ # Vendored from
activesupport/lib/active_support/testing/tagged_logging.rb
+ # This implements the tagged_logger method where it is expected, but
+ # doesn't call `name` or set it up like Rails does.
+ def tagged_logger
+ @tagged_logger ||= (defined?(Rails.logger) && Rails.logger)
+ end
+ end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/rails/configuration.rb
new/lib/rspec/rails/configuration.rb
--- old/lib/rspec/rails/configuration.rb 2022-04-24 10:27:57.000000000
+0200
+++ new/lib/rspec/rails/configuration.rb 2022-10-18 10:12:58.000000000
+0200
@@ -26,19 +26,19 @@
#
# @api private
DIRECTORY_MAPPINGS = {
- channel: %w[spec channels],
+ channel: %w[spec channels],
controller: %w[spec controllers],
- generator: %w[spec generator],
- helper: %w[spec helpers],
- job: %w[spec jobs],
- mailer: %w[spec mailers],
- model: %w[spec models],
- request: %w[spec (requests|integration|api)],
- routing: %w[spec routing],
- view: %w[spec views],
- feature: %w[spec features],
- system: %w[spec system],
- mailbox: %w[spec mailboxes]
+ generator: %w[spec generator],
+ helper: %w[spec helpers],
+ job: %w[spec jobs],
+ mailer: %w[spec mailers],
+ model: %w[spec models],
+ request: %w[spec (requests|integration|api)],
+ routing: %w[spec routing],
+ view: %w[spec views],
+ feature: %w[spec features],
+ system: %w[spec system],
+ mailbox: %w[spec mailboxes]
}
# Sets up the different example group modules for the different spec types
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/rails/example/rails_example_group.rb
new/lib/rspec/rails/example/rails_example_group.rb
--- old/lib/rspec/rails/example/rails_example_group.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/rspec/rails/example/rails_example_group.rb 2022-10-18
10:12:58.000000000 +0200
@@ -12,6 +12,7 @@
include RSpec::Rails::MinitestLifecycleAdapter
include RSpec::Rails::MinitestAssertionAdapter
include RSpec::Rails::FixtureSupport
+ include RSpec::Rails::TaggedLoggingAdapter if ::Rails::VERSION::MAJOR >=
7
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/rails/example/system_example_group.rb
new/lib/rspec/rails/example/system_example_group.rb
--- old/lib/rspec/rails/example/system_example_group.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/rspec/rails/example/system_example_group.rb 2022-10-18
10:12:58.000000000 +0200
@@ -54,23 +54,22 @@
ActionDispatch::SystemTesting::Server.silence_puma = true
end
+ require 'action_dispatch/system_test_case'
+
begin
require 'capybara'
- require 'action_dispatch/system_test_case'
rescue LoadError => e
abort """
LoadError: #{e.message}
- System test integration requires Rails >= 5.1 and has a hard
+ System test integration has a hard
dependency on a webserver and `capybara`, please add capybara to
your Gemfile and configure a webserver (e.g. `Capybara.server =
- :webrick`) before attempting to use system specs.
+ :puma`) before attempting to use system specs.
""".gsub(/\s+/, ' ').strip
end
- if ::Rails::VERSION::STRING >= '6.0'
- original_before_teardown =
-
::ActionDispatch::SystemTesting::TestHelpers::SetupAndTeardown.instance_method(:before_teardown)
- end
+ original_before_teardown =
+
::ActionDispatch::SystemTesting::TestHelpers::SetupAndTeardown.instance_method(:before_teardown)
original_after_teardown =
::ActionDispatch::SystemTesting::TestHelpers::SetupAndTeardown.instance_method(:after_teardown)
@@ -108,10 +107,7 @@
orig_stdout = $stdout
$stdout = StringIO.new
begin
- if ::Rails::VERSION::STRING >= '6.0'
- original_before_teardown.bind(self).call
- end
- original_after_teardown.bind(self).call
+ original_before_teardown.bind(self).call
ensure
myio = $stdout
myio.rewind
@@ -119,6 +115,11 @@
$stdout = orig_stdout
end
end
+
+ around do |example|
+ example.run
+ original_after_teardown.bind(self).call
+ end
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/rails/example/view_example_group.rb
new/lib/rspec/rails/example/view_example_group.rb
--- old/lib/rspec/rails/example/view_example_group.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/rspec/rails/example/view_example_group.rb 2022-10-18
10:12:58.000000000 +0200
@@ -149,11 +149,11 @@
# the original string.
match = path_regex.match(_default_file_to_render)
- render_options = {template: match[:template]}
- render_options[:handlers] = [match[:handler]] if match[:handler]
+ render_options = { template: match[:template] }
+ render_options[:handlers] = [match[:handler].to_sym] if
match[:handler]
render_options[:formats] = [match[:format].to_sym] if match[:format]
- render_options[:locales] = [match[:locale]] if match[:locale]
- render_options[:variants] = [match[:variant]] if match[:variant]
+ render_options[:locales] = [match[:locale].to_sym] if match[:locale]
+ render_options[:variants] = [match[:variant].to_sym] if
match[:variant]
render_options
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/rails/feature_check.rb
new/lib/rspec/rails/feature_check.rb
--- old/lib/rspec/rails/feature_check.rb 2022-04-24 10:27:57.000000000
+0200
+++ new/lib/rspec/rails/feature_check.rb 2022-10-18 10:12:58.000000000
+0200
@@ -24,17 +24,21 @@
end
def has_action_cable_testing?
- defined?(::ActionCable) && ActionCable::VERSION::MAJOR >= 6
+ defined?(::ActionCable)
end
def has_action_mailer_parameterized?
- has_action_mailer? && defined?(::ActionMailer::Parameterized)
+ has_action_mailer? &&
defined?(::ActionMailer::Parameterized::DeliveryJob)
end
def has_action_mailer_unified_delivery?
has_action_mailer? && defined?(::ActionMailer::MailDeliveryJob)
end
+ def has_action_mailer_legacy_delivery_job?
+ defined?(ActionMailer::DeliveryJob)
+ end
+
def has_action_mailbox?
defined?(::ActionMailbox)
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/rails/fixture_file_upload_support.rb
new/lib/rspec/rails/fixture_file_upload_support.rb
--- old/lib/rspec/rails/fixture_file_upload_support.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/rspec/rails/fixture_file_upload_support.rb 2022-10-18
10:12:58.000000000 +0200
@@ -6,41 +6,24 @@
private
- # In Rails 6.2 fixture file path needs to be relative to
`file_fixture_path` instead, this change
- # was brought in with a deprecation warning on 6.1. In Rails 6.2 expect
to rework this to remove
+ # In Rails 7.0 fixture file path needs to be relative to
`file_fixture_path` instead, this change
+ # was brought in with a deprecation warning on 6.1. In Rails 7.0 expect
to rework this to remove
# the old accessor.
- if ::Rails.version.to_f >= 6.1
- def rails_fixture_file_wrapper
- RailsFixtureFileWrapper.file_fixture_path = nil
- resolved_fixture_path =
- if respond_to?(:file_fixture_path) && !file_fixture_path.nil?
- file_fixture_path.to_s
- else
- (RSpec.configuration.fixture_path || '').to_s
- end
- RailsFixtureFileWrapper.file_fixture_path =
File.join(resolved_fixture_path, '') unless resolved_fixture_path.strip.empty?
- RailsFixtureFileWrapper.instance
- end
- else
- def rails_fixture_file_wrapper
- RailsFixtureFileWrapper.fixture_path = nil
- resolved_fixture_path =
- if respond_to?(:fixture_path) && !fixture_path.nil?
- fixture_path.to_s
- else
- (RSpec.configuration.fixture_path || '').to_s
- end
- RailsFixtureFileWrapper.fixture_path =
File.join(resolved_fixture_path, '') unless resolved_fixture_path.strip.empty?
- RailsFixtureFileWrapper.instance
- end
+ def rails_fixture_file_wrapper
+ RailsFixtureFileWrapper.file_fixture_path = nil
+ resolved_fixture_path =
+ if respond_to?(:file_fixture_path) && !file_fixture_path.nil?
+ file_fixture_path.to_s
+ else
+ (RSpec.configuration.fixture_path || '').to_s
+ end
+ RailsFixtureFileWrapper.file_fixture_path =
File.join(resolved_fixture_path, '') unless resolved_fixture_path.strip.empty?
+ RailsFixtureFileWrapper.instance
end
class RailsFixtureFileWrapper
include ActionDispatch::TestProcess if
defined?(ActionDispatch::TestProcess)
-
- if ::Rails.version.to_f >= 6.1
- include ActiveSupport::Testing::FileFixtures
- end
+ include ActiveSupport::Testing::FileFixtures
class << self
attr_accessor :fixture_path
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/rails/fixture_support.rb
new/lib/rspec/rails/fixture_support.rb
--- old/lib/rspec/rails/fixture_support.rb 2022-04-24 10:27:57.000000000
+0200
+++ new/lib/rspec/rails/fixture_support.rb 2022-10-18 10:12:58.000000000
+0200
@@ -46,7 +46,7 @@
def
proxy_method_warning_if_called_in_before_context_scope(method_name)
orig_implementation = instance_method(method_name)
define_method(method_name) do |*args, &blk|
- if inspect.include?("before(:context)")
+ if RSpec.current_scope == :before_context_hook
RSpec.warn_with("Calling fixture method in before :context ")
else
orig_implementation.bind(self).call(*args, &blk)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lib/rspec/rails/matchers/action_cable/have_broadcasted_to.rb
new/lib/rspec/rails/matchers/action_cable/have_broadcasted_to.rb
--- old/lib/rspec/rails/matchers/action_cable/have_broadcasted_to.rb
2022-04-24 10:27:57.000000000 +0200
+++ new/lib/rspec/rails/matchers/action_cable/have_broadcasted_to.rb
2022-10-18 10:12:58.000000000 +0200
@@ -159,7 +159,7 @@
def check_channel_presence
return if @channel.present? && @channel.respond_to?(:channel_name)
- error_msg = "Broadcasting channel can't be infered. Please,
specify it with `from_channel`"
+ error_msg = "Broadcasting channel can't be inferred. Please,
specify it with `from_channel`"
raise ArgumentError, error_msg
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/rails/matchers/active_job.rb
new/lib/rspec/rails/matchers/active_job.rb
--- old/lib/rspec/rails/matchers/active_job.rb 2022-04-24 10:27:57.000000000
+0200
+++ new/lib/rspec/rails/matchers/active_job.rb 2022-10-18 10:12:58.000000000
+0200
@@ -181,7 +181,7 @@
|`Time.current.change(usec: 0)`
|
|Note: RSpec cannot do this for you because jobs can be scheduled
with usec
- |precision and we do not know wether it is on purpose or not.
+ |precision and we do not know whether it is on purpose or not.
|
|
WARNING
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/rails/matchers/have_enqueued_mail.rb
new/lib/rspec/rails/matchers/have_enqueued_mail.rb
--- old/lib/rspec/rails/matchers/have_enqueued_mail.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/rspec/rails/matchers/have_enqueued_mail.rb 2022-10-18
10:12:58.000000000 +0200
@@ -134,7 +134,7 @@
end
# Ruby 3.1 changed how params were serialized on Rails 6.1
- # so we override the active job implementation and customise it here.
+ # so we override the active job implementation and customize it here.
def deserialize_arguments(job)
args = super
@@ -158,7 +158,7 @@
end
def legacy_mail?(job)
- job[:job] <= ActionMailer::DeliveryJob
+ RSpec::Rails::FeatureCheck.has_action_mailer_legacy_delivery_job? &&
job[:job] <= ActionMailer::DeliveryJob
end
def parameterized_mail?(job)
@@ -169,6 +169,7 @@
RSpec::Rails::FeatureCheck.has_action_mailer_unified_delivery? &&
job[:job] <= ActionMailer::MailDeliveryJob
end
end
+
# @api public
# Passes if an email has been enqueued inside block.
# May chain with to specify expected arguments.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/rails/matchers/have_http_status.rb
new/lib/rspec/rails/matchers/have_http_status.rb
--- old/lib/rspec/rails/matchers/have_http_status.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/rspec/rails/matchers/have_http_status.rb 2022-10-18
10:12:58.000000000 +0200
@@ -305,7 +305,7 @@
private
- # @return [String] formating the expected status and associated
code(s)
+ # @return [String] formatting the expected status and associated
code(s)
def type_message
@type_message ||= (expected == :error ? "an error" : "a
#{expected}") +
" status code (#{type_codes})"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/rails/matchers/routing_matchers.rb
new/lib/rspec/rails/matchers/routing_matchers.rb
--- old/lib/rspec/rails/matchers/routing_matchers.rb 2022-04-24
10:27:57.000000000 +0200
+++ new/lib/rspec/rails/matchers/routing_matchers.rb 2022-10-18
10:12:58.000000000 +0200
@@ -26,7 +26,7 @@
path, query = *verb_to_path_map.values.first.split('?')
@scope.assert_recognizes(
@expected,
- {method: verb_to_path_map.keys.first, path: path},
+ { method: verb_to_path_map.keys.first, path: path },
Rack::Utils.parse_nested_query(query)
)
end
@@ -115,7 +115,7 @@
# Shorthand method for matching this type of route.
%w[get post put patch delete options head].each do |method|
define_method method do |path|
- {method.to_sym => path}
+ { method.to_sym => path }
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/rails/vendor/capybara.rb
new/lib/rspec/rails/vendor/capybara.rb
--- old/lib/rspec/rails/vendor/capybara.rb 2022-04-24 10:27:57.000000000
+0200
+++ new/lib/rspec/rails/vendor/capybara.rb 2022-10-18 10:12:58.000000000
+0200
@@ -12,9 +12,7 @@
RSpec.configure do |c|
if defined?(Capybara::DSL)
c.include Capybara::DSL, type: :feature
- if defined?(ActionPack) && ActionPack::VERSION::STRING >= "5.1"
- c.include Capybara::DSL, type: :system
- end
+ c.include Capybara::DSL, type: :system
end
if defined?(Capybara::RSpecMatchers)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/rails/version.rb
new/lib/rspec/rails/version.rb
--- old/lib/rspec/rails/version.rb 2022-04-24 10:27:57.000000000 +0200
+++ new/lib/rspec/rails/version.rb 2022-10-18 10:12:58.000000000 +0200
@@ -3,7 +3,7 @@
# Version information for RSpec Rails.
module Version
# Current version of RSpec Rails, in semantic versioning format.
- STRING = '5.1.2'
+ STRING = '6.0.1'
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/rails/view_assigns.rb
new/lib/rspec/rails/view_assigns.rb
--- old/lib/rspec/rails/view_assigns.rb 2022-04-24 10:27:57.000000000 +0200
+++ new/lib/rspec/rails/view_assigns.rb 2022-10-18 10:12:58.000000000 +0200
@@ -13,26 +13,8 @@
end
# Compat-shim for AbstractController::Rendering#view_assigns
- #
- # _assigns was deprecated in favor of view_assigns after
- # Rails-3.0.0 was released. Since we are not able to predict when
- # the _assigns/view_assigns patch will be released (I thought it
- # would have been in 3.0.1, but 3.0.1 bypassed this change for a
- # security fix), this bit ensures that we do the right thing without
- # knowing anything about the Rails version we are dealing with.
- #
- # Once that change _is_ released, this can be changed to something
- # that checks for the Rails version when the module is being
- # interpreted, as it was before commit dd0095.
def view_assigns
super.merge(_encapsulated_assigns)
- rescue
- _assigns
- end
-
- # @private
- def _assigns
- super.merge(_encapsulated_assigns)
end
private
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/rails/view_rendering.rb
new/lib/rspec/rails/view_rendering.rb
--- old/lib/rspec/rails/view_rendering.rb 2022-04-24 10:27:57.000000000
+0200
+++ new/lib/rspec/rails/view_rendering.rb 2022-10-18 10:12:58.000000000
+0200
@@ -62,14 +62,8 @@
end
end
- if ::Rails::VERSION::STRING >= '6'
- def self.template_format(template)
- template.format
- end
- else
- def self.template_format(template)
- template.formats
- end
+ def self.template_format(template)
+ template.format
end
# Delegates all methods to the submitted resolver and for all methods
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec-rails.rb new/lib/rspec-rails.rb
--- old/lib/rspec-rails.rb 2022-04-24 10:27:57.000000000 +0200
+++ new/lib/rspec-rails.rb 2022-10-18 10:12:58.000000000 +0200
@@ -8,11 +8,7 @@
class Railtie < ::Rails::Railtie
# As of Rails 5.1.0 you can register directories to work with `rake
notes`
require 'rails/source_annotation_extractor'
- if ::Rails::VERSION::STRING >= '6.0'
-
::Rails::SourceAnnotationExtractor::Annotation.register_directories("spec")
- else
- SourceAnnotationExtractor::Annotation.register_directories("spec")
- end
+
::Rails::SourceAnnotationExtractor::Annotation.register_directories("spec")
generators = config.app_generators
generators.integration_tool :rspec
generators.test_framework :rspec
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2022-04-24 10:27:57.000000000 +0200
+++ new/metadata 2022-10-18 10:12:58.000000000 +0200
@@ -1,7 +1,7 @@
--- !ruby/object:Gem::Specification
name: rspec-rails
version: !ruby/object:Gem::Version
- version: 5.1.2
+ version: 6.0.1
platform: ruby
authors:
- David Chelimsky
@@ -44,7 +44,7 @@
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
F3MdtaDehhjC
-----END CERTIFICATE-----
-date: 2022-04-24 00:00:00.000000000 Z
+date: 2022-10-18 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: actionpack
@@ -52,98 +52,98 @@
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: '5.2'
+ version: '6.1'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: '5.2'
+ version: '6.1'
- !ruby/object:Gem::Dependency
name: activesupport
requirement: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: '5.2'
+ version: '6.1'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: '5.2'
+ version: '6.1'
- !ruby/object:Gem::Dependency
name: railties
requirement: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: '5.2'
+ version: '6.1'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: '5.2'
+ version: '6.1'
- !ruby/object:Gem::Dependency
name: rspec-core
requirement: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: '3.10'
+ version: '3.11'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: '3.10'
+ version: '3.11'
- !ruby/object:Gem::Dependency
name: rspec-expectations
requirement: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: '3.10'
+ version: '3.11'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: '3.10'
+ version: '3.11'
- !ruby/object:Gem::Dependency
name: rspec-mocks
requirement: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: '3.10'
+ version: '3.11'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: '3.10'
+ version: '3.11'
- !ruby/object:Gem::Dependency
name: rspec-support
requirement: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: '3.10'
+ version: '3.11'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: '3.10'
+ version: '3.11'
- !ruby/object:Gem::Dependency
name: ammeter
requirement: !ruby/object:Gem::Requirement
@@ -176,28 +176,16 @@
name: cucumber
requirement: !ruby/object:Gem::Requirement
requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: '3.2'
- - - "!="
- - !ruby/object:Gem::Version
- version: 4.0.0
- - - "<"
+ - - "~>"
- !ruby/object:Gem::Version
- version: 8.0.0
+ version: '7.0'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: '3.2'
- - - "!="
- - !ruby/object:Gem::Version
- version: 4.0.0
- - - "<"
+ - - "~>"
- !ruby/object:Gem::Version
- version: 8.0.0
+ version: '7.0'
description: rspec-rails is a testing framework for Rails 5+.
email: [email protected]
executables: []
@@ -228,7 +216,6 @@
- lib/generators/rspec/install/install_generator.rb
- lib/generators/rspec/install/templates/spec/rails_helper.rb
- lib/generators/rspec/integration/integration_generator.rb
-- lib/generators/rspec/integration/templates/request_spec.rb
- lib/generators/rspec/job/job_generator.rb
- lib/generators/rspec/job/templates/job_spec.rb.erb
- lib/generators/rspec/mailbox/mailbox_generator.rb
@@ -241,6 +228,7 @@
- lib/generators/rspec/model/templates/fixtures.yml
- lib/generators/rspec/model/templates/model_spec.rb
- lib/generators/rspec/request/request_generator.rb
+- lib/generators/rspec/request/templates/request_spec.rb
- lib/generators/rspec/scaffold/scaffold_generator.rb
- lib/generators/rspec/scaffold/templates/api_controller_spec.rb
- lib/generators/rspec/scaffold/templates/api_request_spec.rb
@@ -308,7 +296,7 @@
- MIT
metadata:
bug_tracker_uri: https://github.com/rspec/rspec-rails/issues
- changelog_uri: https://github.com/rspec/rspec-rails/blob/v5.1.2/Changelog.md
+ changelog_uri: https://github.com/rspec/rspec-rails/blob/v6.0.1/Changelog.md
documentation_uri: https://rspec.info/documentation/
mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
source_code_uri: https://github.com/rspec/rspec-rails
@@ -321,7 +309,7 @@
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: 2.2.0
+ version: 2.5.0
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
Binary files old/metadata.gz.sig and new/metadata.gz.sig differ