rspec-rails 5.1.2 → 6.0.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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/Changelog.md +39 -6
  4. data/README.md +6 -4
  5. data/lib/generators/rspec/channel/channel_generator.rb +1 -1
  6. data/lib/generators/rspec/controller/controller_generator.rb +4 -4
  7. data/lib/generators/rspec/feature/feature_generator.rb +1 -1
  8. data/lib/generators/rspec/generator/generator_generator.rb +1 -1
  9. data/lib/generators/rspec/helper/helper_generator.rb +1 -1
  10. data/lib/generators/rspec/install/install_generator.rb +19 -2
  11. data/lib/generators/rspec/install/templates/spec/rails_helper.rb +2 -3
  12. data/lib/generators/rspec/integration/integration_generator.rb +10 -3
  13. data/lib/generators/rspec/job/job_generator.rb +1 -1
  14. data/lib/generators/rspec/mailbox/mailbox_generator.rb +1 -1
  15. data/lib/generators/rspec/mailer/mailer_generator.rb +3 -3
  16. data/lib/generators/rspec/model/model_generator.rb +3 -3
  17. data/lib/generators/rspec/request/request_generator.rb +10 -3
  18. data/lib/generators/rspec/{integration → request}/templates/request_spec.rb +0 -0
  19. data/lib/generators/rspec/scaffold/scaffold_generator.rb +4 -4
  20. data/lib/generators/rspec/scaffold/templates/controller_spec.rb +15 -0
  21. data/lib/generators/rspec/scaffold/templates/edit_spec.rb +8 -4
  22. data/lib/generators/rspec/scaffold/templates/index_spec.rb +2 -1
  23. data/lib/generators/rspec/scaffold/templates/request_spec.rb +15 -0
  24. data/lib/generators/rspec/scaffold/templates/show_spec.rb +1 -1
  25. data/lib/generators/rspec/system/system_generator.rb +1 -1
  26. data/lib/generators/rspec/view/view_generator.rb +2 -2
  27. data/lib/generators/rspec.rb +18 -1
  28. data/lib/rspec/rails/adapters.rb +11 -0
  29. data/lib/rspec/rails/configuration.rb +12 -12
  30. data/lib/rspec/rails/example/rails_example_group.rb +1 -0
  31. data/lib/rspec/rails/example/system_example_group.rb +12 -11
  32. data/lib/rspec/rails/example/view_example_group.rb +4 -4
  33. data/lib/rspec/rails/feature_check.rb +6 -2
  34. data/lib/rspec/rails/fixture_file_upload_support.rb +13 -30
  35. data/lib/rspec/rails/fixture_support.rb +1 -1
  36. data/lib/rspec/rails/matchers/action_cable/have_broadcasted_to.rb +1 -1
  37. data/lib/rspec/rails/matchers/active_job.rb +1 -1
  38. data/lib/rspec/rails/matchers/have_enqueued_mail.rb +3 -2
  39. data/lib/rspec/rails/matchers/have_http_status.rb +1 -1
  40. data/lib/rspec/rails/matchers/routing_matchers.rb +2 -2
  41. data/lib/rspec/rails/vendor/capybara.rb +1 -3
  42. data/lib/rspec/rails/version.rb +1 -1
  43. data/lib/rspec/rails/view_assigns.rb +0 -18
  44. data/lib/rspec/rails/view_rendering.rb +2 -8
  45. data/lib/rspec-rails.rb +1 -5
  46. data.tar.gz.sig +0 -0
  47. metadata +23 -35
  48. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be221e5df3386cb55e14f8047e02628bc11098596dcce06749701ac0b7497782
4
- data.tar.gz: 56b12531541ff18599c13618ba2937859bb4cd860cc814b3350046ec4949e870
3
+ metadata.gz: 5168244eb73c17800e3ab180f39a65e3400e31fd559cb4f9d44f132f4cecd7f5
4
+ data.tar.gz: e11a77cd0bb1dca2d8f4ad2c1e521e6f7e25fd7d73f564aeaa570bdcd6dbf59c
5
5
  SHA512:
6
- metadata.gz: a1786502c478ab9de29fbd59ce16371178776a7283698ba048b203f62aa614fc6c28e4c72b5064595f4eacd2cf309443de8d0d6803ac604e9d11a641c6f86c4b
7
- data.tar.gz: 5860654b1926c2f2cdd998d2b84ac075167f7107bd687b74dae5bb9e17d7e76ef6b0c96dd022ec7a9be5dc0fe008e845808187080e97b400bec18b35d1872e76
6
+ metadata.gz: 218fc008c49a73cde670d9b1141d47e4b5541ec409fee39dfe5ba864613a5c02862139a55647ef92032eebf2e429597e4e202376e4529761494250efe50f98e6
7
+ data.tar.gz: ef02cdf73abce39f27b84b26f43b40c102a9ba52893de8831666c1f1688ee588320998155c88a8284e576a2a53b76eb29e4be8ef62c232382da46e946dec5ca1
checksums.yaml.gz.sig CHANGED
Binary file
data/Changelog.md CHANGED
@@ -1,5 +1,37 @@
1
1
  ### Development
2
- [Full Changelog](https://github.com/rspec/rspec-rails/compare/v5.1.1...5-1-maintenance)
2
+ [Full Changelog](https://github.com/rspec/rspec-rails/compare/v6.0.0...6-0-maintenance)
3
+
4
+ ### 6.0.1 / 2022-10-18
5
+ [Full Changelog](https://github.com/rspec/rspec-rails/compare/v6.0.0...6.0.1)
6
+
7
+ Bug Fixes:
8
+
9
+ * Prevent tagged logged support in Rails 7 calling `#name`. (Jon Rowe, #2625)
10
+
11
+ ### 6.0.0 / 2022-10-10
12
+ [Full Changelog](https://github.com/rspec/rspec-rails/compare/v5.1.2...6.0.0)
13
+
14
+ Enhancements:
15
+
16
+ * Support Rails 7
17
+ * Template tweaks to remove instance variables from generated specs. (Takuma Ishikawa, #2599)
18
+ * Generators now respects default path configuration option. (@vivekmiyani, #2508)
19
+
20
+ Breaking Changes:
21
+
22
+ * Drop support for Rails below 6.1
23
+ * Drop support for Ruby below 2.5 (following supported versions of Rails 6.1)
24
+ * Change the order of `after_teardown` from `after` to `around` in system
25
+ specs to improve compatibility with extensions and Capybara. (Tim Diggins, #2596)
26
+
27
+ Deprecations:
28
+
29
+ * Deprecates integration spec generator (`rspec:integration`)
30
+ which was an alias of request spec generator (`rspec:request`)
31
+ (Luka Lüdicke, #2374)
32
+
33
+ ### 5.1.2 / 2022-04-24
34
+ [Full Changelog](https://github.com/rspec/rspec-rails/compare/v5.1.1...v5.1.2)
3
35
 
4
36
  Bug Fixes:
5
37
 
@@ -31,8 +63,9 @@ Bug Fixes:
31
63
 
32
64
  * Properly name params in controller and request spec templates when
33
65
  using the `--model-name` parameter. (@kenzo-tanaka, #2534)
34
- * Fix support for `have_enqueued_mail` on Ruby 3.1 with Rails 6.1.
35
- (Fabio Napoleoni, Mikael Henriksson, Phil Pirozhkov, Jon Rowe, #2566)
66
+ * Fix parameter matching with mail delivery job and
67
+ ActionMailer::MailDeliveryJob. (Fabio Napoleoni, #2516, #2546)
68
+ * Fix Rails 7 `have_enqueued_mail` compatibility (Mikael Henriksson, #2537, #2546)
36
69
 
37
70
  ### 5.0.2 / 2021-08-14
38
71
  [Full Changelog](https://github.com/rspec/rspec-rails/compare/v5.0.1...v5.0.2)
@@ -78,7 +111,7 @@ Bug Fixes:
78
111
 
79
112
  Enhancements:
80
113
 
81
- * Issue a warning when using job matchers with `#at` mis-match on `usec` precision.
114
+ * Issue a warning when using job matchers with `#at` mismatch on `usec` precision.
82
115
  (Jon Rowe, #2350)
83
116
  * Generated request specs now have a bare `_spec` suffix instead of `request_spec`.
84
117
  (Eloy Espinaco, Luka Lüdicke, #2355, #2356, #2378)
@@ -205,7 +238,7 @@ Bug Fixes:
205
238
 
206
239
  Bug Fixes:
207
240
 
208
- * Namespaced fixtures now generate a `/` seperated path rather than an `_`.
241
+ * Namespaced fixtures now generate a `/` separated path rather than an `_`.
209
242
  (@nxlith, #2077)
210
243
  * Check the arity of `errors` before attempting to use it to generate the `be_valid`
211
244
  error message. (Kevin Kuchta, #2096)
@@ -365,7 +398,7 @@ Enhancements:
365
398
 
366
399
  Bug fixes:
367
400
 
368
- * Prevent asset helpers from taking precendence over route helpers. (Prem Sichanugrist, #1496)
401
+ * Prevent asset helpers from taking precedence over route helpers. (Prem Sichanugrist, #1496)
369
402
  * Prevent `NoMethodError` during failed `have_rendered` assertions on weird templates.
370
403
  (Jon Rowe, #1623).
371
404
 
data/README.md CHANGED
@@ -9,7 +9,8 @@ detailed explanations of how the application is supposed to behave,
9
9
  expressed in plain English.
10
10
 
11
11
  According to [RSpec Rails new versioning strategy][] use:
12
- * **[`rspec-rails` 5.x][]** for Rails 6.x.
12
+ * **[`rspec-rails` 6.x][]** for Rails 6.1 or 7.x.
13
+ * **[`rspec-rails` 5.x][]** for Rails 5.2 or 6.x.
13
14
  * **[`rspec-rails` 4.x][]** for Rails from 5.x or 6.x.
14
15
  * **[`rspec-rails` 3.x][]** for Rails earlier than 5.0.
15
16
  * **[`rspec-rails` 1.x][]** for Rails 2.x.
@@ -25,13 +26,14 @@ According to [RSpec Rails new versioning strategy][] use:
25
26
  [`rspec-rails` 1.x]: https://github.com/dchelimsky/rspec-rails
26
27
  [`rspec-rails` 3.x]: https://github.com/rspec/rspec-rails/tree/3-9-maintenance
27
28
  [`rspec-rails` 4.x]: https://github.com/rspec/rspec-rails/tree/4-1-maintenance
28
- [`rspec-rails` 5.x]: https://github.com/rspec/rspec-rails/tree/5-0-maintenance
29
+ [`rspec-rails` 5.x]: https://github.com/rspec/rspec-rails/tree/5-1-maintenance
30
+ [`rspec-rails` 6.x]: https://github.com/rspec/rspec-rails/tree/6-0-maintenance
29
31
  [RSpec Rails new versioning strategy]: https://github.com/rspec/rspec-rails/blob/main/rfcs/versioning-strategy.md
30
32
 
31
33
  ## Installation
32
34
 
33
35
  **IMPORTANT** This README / branch refers to the current development build.
34
- 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.
36
+ 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.
35
37
 
36
38
  1. Add `rspec-rails` to **both** the `:development` and `:test` groups
37
39
  of your app’s `Gemfile`:
@@ -39,7 +41,7 @@ See the [`5-0-maintenance` branch on Github](https://github.com/rspec/rspec-rail
39
41
  ```ruby
40
42
  # Run against this stable release
41
43
  group :development, :test do
42
- gem 'rspec-rails', '~> 5.0.0'
44
+ gem 'rspec-rails', '~> 6.0.0'
43
45
  end
44
46
 
45
47
  # Or, run against the main branch
@@ -5,7 +5,7 @@ module Rspec
5
5
  # @private
6
6
  class ChannelGenerator < Base
7
7
  def create_channel_spec
8
- template 'channel_spec.rb.erb', File.join('spec/channels', class_path, "#{file_name}_channel_spec.rb")
8
+ template 'channel_spec.rb.erb', target_path('channels', class_path, "#{file_name}_channel_spec.rb")
9
9
  end
10
10
  end
11
11
  end
@@ -16,14 +16,14 @@ module Rspec
16
16
  return unless options[:request_specs]
17
17
 
18
18
  template 'request_spec.rb',
19
- File.join('spec/requests', class_path, "#{file_name}_spec.rb")
19
+ target_path('requests', class_path, "#{file_name}_spec.rb")
20
20
  end
21
21
 
22
22
  def generate_controller_spec
23
23
  return unless options[:controller_specs]
24
24
 
25
25
  template 'controller_spec.rb',
26
- File.join('spec/controllers', class_path, "#{file_name}_controller_spec.rb")
26
+ target_path('controllers', class_path, "#{file_name}_controller_spec.rb")
27
27
  end
28
28
 
29
29
  def generate_view_specs
@@ -35,7 +35,7 @@ module Rspec
35
35
  actions.each do |action|
36
36
  @action = action
37
37
  template 'view_spec.rb',
38
- File.join("spec", "views", file_path, "#{@action}.html.#{options[:template_engine]}_spec.rb")
38
+ target_path('views', file_path, "#{@action}.html.#{options[:template_engine]}_spec.rb")
39
39
  end
40
40
  end
41
41
 
@@ -44,7 +44,7 @@ module Rspec
44
44
  return unless options[:routing_specs]
45
45
 
46
46
  template 'routing_spec.rb',
47
- File.join('spec/routing', class_path, "#{file_name}_routing_spec.rb")
47
+ target_path('routing', class_path, "#{file_name}_routing_spec.rb")
48
48
  end
49
49
  end
50
50
  end
@@ -10,7 +10,7 @@ module Rspec
10
10
  def generate_feature_spec
11
11
  return unless options[:feature_specs]
12
12
 
13
- template template_name, File.join('spec/features', class_path, filename)
13
+ template template_name, target_path('features', class_path, filename)
14
14
  end
15
15
 
16
16
  def template_name
@@ -9,7 +9,7 @@ module Rspec
9
9
  def generate_generator_spec
10
10
  return unless options[:generator_specs]
11
11
 
12
- template template_name, File.join('spec/generator', class_path, filename)
12
+ template template_name, target_path('generator', class_path, filename)
13
13
  end
14
14
 
15
15
  def template_name
@@ -9,7 +9,7 @@ module Rspec
9
9
  def generate_helper_spec
10
10
  return unless options[:helper_specs]
11
11
 
12
- template 'helper_spec.rb', File.join('spec/helpers', class_path, "#{file_name}_helper_spec.rb")
12
+ template 'helper_spec.rb', target_path('helpers', class_path, "#{file_name}_helper_spec.rb")
13
13
  end
14
14
  end
15
15
  end
@@ -12,6 +12,8 @@ Description:
12
12
  Copy rspec files to your application.
13
13
  DESC
14
14
 
15
+ class_option :default_path, type: :string, default: 'spec'
16
+
15
17
  def self.source_root
16
18
  @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
17
19
  end
@@ -20,12 +22,12 @@ DESC
20
22
  Dir.mktmpdir do |dir|
21
23
  generate_rspec_init dir
22
24
  template File.join(dir, '.rspec'), '.rspec'
23
- directory File.join(dir, 'spec'), 'spec'
25
+ directory File.join(dir, 'spec'), default_path
24
26
  end
25
27
  end
26
28
 
27
29
  def copy_rails_files
28
- template 'spec/rails_helper.rb'
30
+ template 'spec/rails_helper.rb', "#{default_path}/rails_helper.rb"
29
31
  end
30
32
 
31
33
  private
@@ -41,6 +43,12 @@ DESC
41
43
 
42
44
  replace_generator_command(spec_helper_path)
43
45
  remove_warnings_configuration(spec_helper_path)
46
+
47
+ unless default_path == "spec"
48
+ dot_rspec_path = File.join(tmpdir, '.rspec')
49
+
50
+ append_default_path(dot_rspec_path)
51
+ end
44
52
  end
45
53
 
46
54
  def replace_generator_command(spec_helper_path)
@@ -58,6 +66,15 @@ DESC
58
66
  '',
59
67
  verbose: false
60
68
  end
69
+
70
+ def append_default_path(dot_rspec_path)
71
+ append_to_file dot_rspec_path,
72
+ "--default-path #{default_path}"
73
+ end
74
+
75
+ def default_path
76
+ options[:default_path]
77
+ end
61
78
  end
62
79
  end
63
80
  end
@@ -28,8 +28,7 @@ require 'rspec/rails'
28
28
  begin
29
29
  ActiveRecord::Migration.maintain_test_schema!
30
30
  rescue ActiveRecord::PendingMigrationError => e
31
- puts e.to_s.strip
32
- exit 1
31
+ abort e.to_s.strip
33
32
  end
34
33
  <% end -%>
35
34
  RSpec.configure do |config|
@@ -49,7 +48,7 @@ RSpec.configure do |config|
49
48
  # Remove this line to enable support for ActiveRecord
50
49
  config.use_active_record = false
51
50
 
52
- # If you enable ActiveRecord support you should unncomment these lines,
51
+ # If you enable ActiveRecord support you should uncomment these lines,
53
52
  # note if you'd prefer not to run each example within a transaction, you
54
53
  # should set use_transactional_fixtures to false.
55
54
  #
@@ -1,21 +1,28 @@
1
1
  require 'generators/rspec'
2
+ require 'rspec/core/warnings'
2
3
 
3
4
  module Rspec
4
5
  module Generators
5
6
  # @private
6
7
  class IntegrationGenerator < Base
7
- # Add a deprecation for this class, before rspec-rails 4, to use the
8
- # `RequestGenerator` instead
9
8
  class_option :request_specs,
10
9
  type: :boolean,
11
10
  default: true,
12
11
  desc: "Generate request specs"
13
12
 
13
+ source_paths << File.expand_path('../request/templates', __dir__)
14
+
14
15
  def generate_request_spec
15
16
  return unless options[:request_specs]
16
17
 
18
+ RSpec.warn_deprecation <<-WARNING.gsub(/\s*\|/, ' ')
19
+ |The integration generator is deprecated
20
+ |and will be deleted in RSpec-Rails 7.
21
+ |Please use the request generator instead.
22
+ WARNING
23
+
17
24
  template 'request_spec.rb',
18
- File.join('spec/requests', "#{name.underscore.pluralize}_spec.rb")
25
+ target_path('requests', "#{name.underscore.pluralize}_spec.rb")
19
26
  end
20
27
  end
21
28
  end
@@ -6,7 +6,7 @@ module Rspec
6
6
  class JobGenerator < Base
7
7
  def create_job_spec
8
8
  file_suffix = file_name.end_with?('job') ? 'spec.rb' : 'job_spec.rb'
9
- template 'job_spec.rb.erb', File.join('spec/jobs', class_path, [file_name, file_suffix].join('_'))
9
+ template 'job_spec.rb.erb', target_path('jobs', class_path, [file_name, file_suffix].join('_'))
10
10
  end
11
11
  end
12
12
  end
@@ -6,7 +6,7 @@ module Rspec
6
6
  class MailboxGenerator < Base
7
7
  def create_mailbox_spec
8
8
  template('mailbox_spec.rb.erb',
9
- File.join('spec/mailboxes', class_path, "#{file_name}_mailbox_spec.rb")
9
+ target_path('mailboxes', class_path, "#{file_name}_mailbox_spec.rb")
10
10
  )
11
11
  end
12
12
  end
@@ -8,20 +8,20 @@ module Rspec
8
8
  argument :actions, type: :array, default: [], banner: "method method"
9
9
 
10
10
  def generate_mailer_spec
11
- template "mailer_spec.rb", File.join('spec/mailers', class_path, "#{file_name}_spec.rb")
11
+ template "mailer_spec.rb", target_path('mailers', class_path, "#{file_name}_spec.rb")
12
12
  end
13
13
 
14
14
  def generate_fixtures_files
15
15
  actions.each do |action|
16
16
  @action, @path = action, File.join(file_path, action)
17
- template "fixture", File.join("spec/fixtures", @path)
17
+ template "fixture", target_path("fixtures", @path)
18
18
  end
19
19
  end
20
20
 
21
21
  def generate_preview_files
22
22
  return unless RSpec::Rails::FeatureCheck.has_action_mailer_preview?
23
23
 
24
- template "preview.rb", File.join("spec/mailers/previews", class_path, "#{file_name}_preview.rb")
24
+ template "preview.rb", target_path("mailers/previews", class_path, "#{file_name}_preview.rb")
25
25
  end
26
26
  end
27
27
  end
@@ -11,8 +11,8 @@ module Rspec
11
11
  class_option :fixture, type: :boolean
12
12
 
13
13
  def create_model_spec
14
- template_file = File.join(
15
- 'spec/models',
14
+ template_file = target_path(
15
+ 'models',
16
16
  class_path,
17
17
  "#{file_name}_spec.rb"
18
18
  )
@@ -24,7 +24,7 @@ module Rspec
24
24
  def create_fixture_file
25
25
  return unless missing_fixture_replacement?
26
26
 
27
- template 'fixtures.yml', File.join('spec/fixtures', class_path, "#{(pluralize_table_names? ? plural_file_name : file_name)}.yml")
27
+ template 'fixtures.yml', target_path('fixtures', class_path, "#{(pluralize_table_names? ? plural_file_name : file_name)}.yml")
28
28
  end
29
29
 
30
30
  private
@@ -1,10 +1,17 @@
1
- require 'generators/rspec/integration/integration_generator'
1
+ require 'generators/rspec'
2
2
 
3
3
  module Rspec
4
4
  module Generators
5
5
  # @private
6
- class RequestGenerator < IntegrationGenerator
7
- source_paths << File.expand_path('../integration/templates', __dir__)
6
+ class RequestGenerator < Base
7
+ class_option :request_specs, type: :boolean, default: true, desc: 'Generate request specs'
8
+
9
+ def generate_request_spec
10
+ return unless options[:request_specs]
11
+
12
+ template 'request_spec.rb',
13
+ target_path('requests', "#{name.underscore.pluralize}_spec.rb")
14
+ end
8
15
  end
9
16
  end
10
17
  end
@@ -58,8 +58,8 @@ module Rspec
58
58
  def generate_routing_spec
59
59
  return unless options[:routing_specs]
60
60
 
61
- template_file = File.join(
62
- 'spec/routing',
61
+ template_file = target_path(
62
+ 'routing',
63
63
  controller_class_path,
64
64
  "#{controller_file_name}_routing_spec.rb"
65
65
  )
@@ -72,7 +72,7 @@ module Rspec
72
72
 
73
73
  def copy_view(view)
74
74
  template "#{view}_spec.rb",
75
- File.join("spec/views", controller_file_path, "#{view}.html.#{options[:template_engine]}_spec.rb")
75
+ target_path("views", controller_file_path, "#{view}.html.#{options[:template_engine]}_spec.rb")
76
76
  end
77
77
 
78
78
  # support for namespaced-resources
@@ -121,7 +121,7 @@ module Rspec
121
121
  end
122
122
 
123
123
  def template_file(folder:, suffix: '')
124
- File.join('spec', folder, controller_class_path, "#{controller_file_name}#{suffix}_spec.rb")
124
+ target_path(folder, controller_class_path, "#{controller_file_name}#{suffix}_spec.rb")
125
125
  end
126
126
 
127
127
  def banner
@@ -90,10 +90,17 @@ RSpec.describe <%= controller_class_name %>Controller, <%= type_metatag(:control
90
90
  end
91
91
 
92
92
  context "with invalid params" do
93
+ <% if Rails.version.to_f < 7.0 %>
93
94
  it "returns a success response (i.e. to display the 'new' template)" do
94
95
  post :create, params: {<%= singular_table_name %>: invalid_attributes}, session: valid_session
95
96
  expect(response).to be_successful
96
97
  end
98
+ <% else %>
99
+ it "renders a response with 422 status (i.e. to display the 'new' template)" do
100
+ post :create, params: {<%= singular_table_name %>: invalid_attributes}, session: valid_session
101
+ expect(response).to have_http_status(:unprocessable_entity)
102
+ end
103
+ <% end %>
97
104
  end
98
105
  end
99
106
 
@@ -118,11 +125,19 @@ RSpec.describe <%= controller_class_name %>Controller, <%= type_metatag(:control
118
125
  end
119
126
 
120
127
  context "with invalid params" do
128
+ <% if Rails.version.to_f < 7.0 %>
121
129
  it "returns a success response (i.e. to display the 'edit' template)" do
122
130
  <%= file_name %> = <%= class_name %>.create! valid_attributes
123
131
  put :update, params: {id: <%= file_name %>.to_param, <%= singular_table_name %>: invalid_attributes}, session: valid_session
124
132
  expect(response).to be_successful
125
133
  end
134
+ <% else %>
135
+ it "renders a response with 422 status (i.e. to display the 'edit' template)" do
136
+ <%= file_name %> = <%= class_name %>.create! valid_attributes
137
+ put :update, params: {id: <%= file_name %>.to_param, <%= singular_table_name %>: invalid_attributes}, session: valid_session
138
+ expect(response).to have_http_status(:unprocessable_entity)
139
+ end
140
+ <% end %>
126
141
  end
127
142
  end
128
143
 
@@ -2,18 +2,22 @@ require 'rails_helper'
2
2
 
3
3
  <% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
4
4
  RSpec.describe "<%= ns_table_name %>/edit", <%= type_metatag(:view) %> do
5
- before(:each) do
6
- @<%= ns_file_name %> = assign(:<%= ns_file_name %>, <%= class_name %>.create!(<%= '))' if output_attributes.empty? %>
5
+ let(:<%= ns_file_name %>) {
6
+ <%= class_name %>.create!(<%= ')' if output_attributes.empty? %>
7
7
  <% output_attributes.each_with_index do |attribute, attribute_index| -%>
8
8
  <%= attribute.name %>: <%= attribute.default.inspect %><%= attribute_index == output_attributes.length - 1 ? '' : ','%>
9
9
  <% end -%>
10
- <%= output_attributes.empty? ? "" : " ))\n" -%>
10
+ <%= " )\n" unless output_attributes.empty? -%>
11
+ }
12
+
13
+ before(:each) do
14
+ assign(:<%= ns_file_name %>, <%= ns_file_name %>)
11
15
  end
12
16
 
13
17
  it "renders the edit <%= ns_file_name %> form" do
14
18
  render
15
19
 
16
- assert_select "form[action=?][method=?]", <%= ns_file_name %>_path(@<%= ns_file_name %>), "post" do
20
+ assert_select "form[action=?][method=?]", <%= ns_file_name %>_path(<%= ns_file_name %>), "post" do
17
21
  <% for attribute in output_attributes -%>
18
22
  <%- name = attribute.respond_to?(:column_name) ? attribute.column_name : attribute.name %>
19
23
  assert_select "<%= attribute.input_type -%>[name=?]", "<%= ns_file_name %>[<%= name %>]"
@@ -18,8 +18,9 @@ RSpec.describe "<%= ns_table_name %>/index", <%= type_metatag(:view) %> do
18
18
 
19
19
  it "renders a list of <%= ns_table_name %>" do
20
20
  render
21
+ cell_selector = Rails::VERSION::STRING >= '7' ? 'div>p' : 'tr>td'
21
22
  <% for attribute in output_attributes -%>
22
- assert_select "tr>td", text: <%= value_for(attribute) %>.to_s, count: 2
23
+ assert_select cell_selector, text: Regexp.new(<%= value_for(attribute) %>.to_s), count: 2
23
24
  <% end -%>
24
25
  end
25
26
  end
@@ -83,10 +83,17 @@ RSpec.describe "/<%= name.underscore.pluralize %>", <%= type_metatag(:request) %
83
83
  }.to change(<%= class_name %>, :count).by(0)
84
84
  end
85
85
 
86
+ <% if Rails.version.to_f < 7.0 %>
86
87
  it "renders a successful response (i.e. to display the 'new' template)" do
87
88
  post <%= index_helper %>_url, params: { <%= singular_table_name %>: invalid_attributes }
88
89
  expect(response).to be_successful
89
90
  end
91
+ <% else %>
92
+ it "renders a response with 422 status (i.e. to display the 'new' template)" do
93
+ post <%= index_helper %>_url, params: { <%= singular_table_name %>: invalid_attributes }
94
+ expect(response).to have_http_status(:unprocessable_entity)
95
+ end
96
+ <% end %>
90
97
  end
91
98
  end
92
99
 
@@ -112,11 +119,19 @@ RSpec.describe "/<%= name.underscore.pluralize %>", <%= type_metatag(:request) %
112
119
  end
113
120
 
114
121
  context "with invalid parameters" do
122
+ <% if Rails.version.to_f < 7.0 %>
115
123
  it "renders a successful response (i.e. to display the 'edit' template)" do
116
124
  <%= file_name %> = <%= class_name %>.create! valid_attributes
117
125
  patch <%= show_helper %>, params: { <%= singular_table_name %>: invalid_attributes }
118
126
  expect(response).to be_successful
119
127
  end
128
+ <% else %>
129
+ it "renders a response with 422 status (i.e. to display the 'edit' template)" do
130
+ <%= file_name %> = <%= class_name %>.create! valid_attributes
131
+ patch <%= show_helper %>, params: { <%= singular_table_name %>: invalid_attributes }
132
+ expect(response).to have_http_status(:unprocessable_entity)
133
+ end
134
+ <% end %>
120
135
  end
121
136
  end
122
137
 
@@ -3,7 +3,7 @@ require 'rails_helper'
3
3
  <% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
4
4
  RSpec.describe "<%= ns_table_name %>/show", <%= type_metatag(:view) %> do
5
5
  before(:each) do
6
- @<%= ns_file_name %> = assign(:<%= ns_file_name %>, <%= class_name %>.create!(<%= '))' if output_attributes.empty? %>
6
+ assign(:<%= ns_file_name %>, <%= class_name %>.create!(<%= '))' if output_attributes.empty? %>
7
7
  <% output_attributes.each_with_index do |attribute, attribute_index| -%>
8
8
  <%= attribute.name %>: <%= value_for(attribute) %><%= attribute_index == output_attributes.length - 1 ? '' : ','%>
9
9
  <% end -%>
@@ -9,7 +9,7 @@ module Rspec
9
9
  def generate_system_spec
10
10
  return unless options[:system_specs]
11
11
 
12
- template template_name, File.join('spec/system', class_path, filename)
12
+ template template_name, target_path('system', class_path, filename)
13
13
  end
14
14
 
15
15
  def template_name
@@ -9,12 +9,12 @@ module Rspec
9
9
  class_option :template_engine, desc: "Template engine to generate view files"
10
10
 
11
11
  def create_view_specs
12
- empty_directory File.join("spec", "views", file_path)
12
+ empty_directory target_path("views", file_path)
13
13
 
14
14
  actions.each do |action|
15
15
  @action = action
16
16
  template 'view_spec.rb',
17
- File.join("spec", "views", file_path, "#{@action}.html.#{options[:template_engine]}_spec.rb")
17
+ target_path("views", file_path, "#{@action}.html.#{options[:template_engine]}_spec.rb")
18
18
  end
19
19
  end
20
20
  end
@@ -1,8 +1,9 @@
1
1
  require 'rails/generators/named_base'
2
+ require 'rspec/core'
2
3
  require 'rspec/rails/feature_check'
3
4
 
4
5
  # @private
5
- # Weirdly named generators namespace (should be `RSpec`) for compatability with
6
+ # Weirdly named generators namespace (should be `RSpec`) for compatibility with
6
7
  # rails loading.
7
8
  module Rspec
8
9
  # @private
@@ -18,6 +19,22 @@ module Rspec
18
19
  @_rspec_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'rspec', generator_name, 'templates'))
19
20
  end
20
21
  end
22
+
23
+ # @private
24
+ # Load configuration from RSpec to ensure `--default-path` is set
25
+ def self.configuration
26
+ @configuration ||=
27
+ begin
28
+ configuration = RSpec.configuration
29
+ options = RSpec::Core::ConfigurationOptions.new({})
30
+ options.configure(configuration)
31
+ configuration
32
+ end
33
+ end
34
+
35
+ def target_path(*paths)
36
+ File.join(self.class.configuration.default_path, *paths)
37
+ end
21
38
  end
22
39
  end
23
40
  end
@@ -181,5 +181,16 @@ module RSpec
181
181
  #
182
182
  # @private
183
183
  TestUnitAssertionAdapter = MinitestAssertionAdapter
184
+
185
+ # @private
186
+ module TaggedLoggingAdapter
187
+ private
188
+ # Vendored from activesupport/lib/active_support/testing/tagged_logging.rb
189
+ # This implements the tagged_logger method where it is expected, but
190
+ # doesn't call `name` or set it up like Rails does.
191
+ def tagged_logger
192
+ @tagged_logger ||= (defined?(Rails.logger) && Rails.logger)
193
+ end
194
+ end
184
195
  end
185
196
  end
@@ -26,19 +26,19 @@ module RSpec
26
26
  #
27
27
  # @api private
28
28
  DIRECTORY_MAPPINGS = {
29
- channel: %w[spec channels],
29
+ channel: %w[spec channels],
30
30
  controller: %w[spec controllers],
31
- generator: %w[spec generator],
32
- helper: %w[spec helpers],
33
- job: %w[spec jobs],
34
- mailer: %w[spec mailers],
35
- model: %w[spec models],
36
- request: %w[spec (requests|integration|api)],
37
- routing: %w[spec routing],
38
- view: %w[spec views],
39
- feature: %w[spec features],
40
- system: %w[spec system],
41
- mailbox: %w[spec mailboxes]
31
+ generator: %w[spec generator],
32
+ helper: %w[spec helpers],
33
+ job: %w[spec jobs],
34
+ mailer: %w[spec mailers],
35
+ model: %w[spec models],
36
+ request: %w[spec (requests|integration|api)],
37
+ routing: %w[spec routing],
38
+ view: %w[spec views],
39
+ feature: %w[spec features],
40
+ system: %w[spec system],
41
+ mailbox: %w[spec mailboxes]
42
42
  }
43
43
 
44
44
  # Sets up the different example group modules for the different spec types
@@ -12,6 +12,7 @@ module RSpec
12
12
  include RSpec::Rails::MinitestLifecycleAdapter
13
13
  include RSpec::Rails::MinitestAssertionAdapter
14
14
  include RSpec::Rails::FixtureSupport
15
+ include RSpec::Rails::TaggedLoggingAdapter if ::Rails::VERSION::MAJOR >= 7
15
16
  end
16
17
  end
17
18
  end
@@ -54,23 +54,22 @@ module RSpec
54
54
  ActionDispatch::SystemTesting::Server.silence_puma = true
55
55
  end
56
56
 
57
+ require 'action_dispatch/system_test_case'
58
+
57
59
  begin
58
60
  require 'capybara'
59
- require 'action_dispatch/system_test_case'
60
61
  rescue LoadError => e
61
62
  abort """
62
63
  LoadError: #{e.message}
63
- System test integration requires Rails >= 5.1 and has a hard
64
+ System test integration has a hard
64
65
  dependency on a webserver and `capybara`, please add capybara to
65
66
  your Gemfile and configure a webserver (e.g. `Capybara.server =
66
- :webrick`) before attempting to use system specs.
67
+ :puma`) before attempting to use system specs.
67
68
  """.gsub(/\s+/, ' ').strip
68
69
  end
69
70
 
70
- if ::Rails::VERSION::STRING >= '6.0'
71
- original_before_teardown =
72
- ::ActionDispatch::SystemTesting::TestHelpers::SetupAndTeardown.instance_method(:before_teardown)
73
- end
71
+ original_before_teardown =
72
+ ::ActionDispatch::SystemTesting::TestHelpers::SetupAndTeardown.instance_method(:before_teardown)
74
73
 
75
74
  original_after_teardown =
76
75
  ::ActionDispatch::SystemTesting::TestHelpers::SetupAndTeardown.instance_method(:after_teardown)
@@ -108,10 +107,7 @@ module RSpec
108
107
  orig_stdout = $stdout
109
108
  $stdout = StringIO.new
110
109
  begin
111
- if ::Rails::VERSION::STRING >= '6.0'
112
- original_before_teardown.bind(self).call
113
- end
114
- original_after_teardown.bind(self).call
110
+ original_before_teardown.bind(self).call
115
111
  ensure
116
112
  myio = $stdout
117
113
  myio.rewind
@@ -119,6 +115,11 @@ module RSpec
119
115
  $stdout = orig_stdout
120
116
  end
121
117
  end
118
+
119
+ around do |example|
120
+ example.run
121
+ original_after_teardown.bind(self).call
122
+ end
122
123
  end
123
124
  end
124
125
  end
@@ -149,11 +149,11 @@ module RSpec
149
149
  # the original string.
150
150
  match = path_regex.match(_default_file_to_render)
151
151
 
152
- render_options = {template: match[:template]}
153
- render_options[:handlers] = [match[:handler]] if match[:handler]
152
+ render_options = { template: match[:template] }
153
+ render_options[:handlers] = [match[:handler].to_sym] if match[:handler]
154
154
  render_options[:formats] = [match[:format].to_sym] if match[:format]
155
- render_options[:locales] = [match[:locale]] if match[:locale]
156
- render_options[:variants] = [match[:variant]] if match[:variant]
155
+ render_options[:locales] = [match[:locale].to_sym] if match[:locale]
156
+ render_options[:variants] = [match[:variant].to_sym] if match[:variant]
157
157
 
158
158
  render_options
159
159
  end
@@ -24,17 +24,21 @@ module RSpec
24
24
  end
25
25
 
26
26
  def has_action_cable_testing?
27
- defined?(::ActionCable) && ActionCable::VERSION::MAJOR >= 6
27
+ defined?(::ActionCable)
28
28
  end
29
29
 
30
30
  def has_action_mailer_parameterized?
31
- has_action_mailer? && defined?(::ActionMailer::Parameterized)
31
+ has_action_mailer? && defined?(::ActionMailer::Parameterized::DeliveryJob)
32
32
  end
33
33
 
34
34
  def has_action_mailer_unified_delivery?
35
35
  has_action_mailer? && defined?(::ActionMailer::MailDeliveryJob)
36
36
  end
37
37
 
38
+ def has_action_mailer_legacy_delivery_job?
39
+ defined?(ActionMailer::DeliveryJob)
40
+ end
41
+
38
42
  def has_action_mailbox?
39
43
  defined?(::ActionMailbox)
40
44
  end
@@ -6,41 +6,24 @@ module RSpec
6
6
 
7
7
  private
8
8
 
9
- # In Rails 6.2 fixture file path needs to be relative to `file_fixture_path` instead, this change
10
- # was brought in with a deprecation warning on 6.1. In Rails 6.2 expect to rework this to remove
9
+ # In Rails 7.0 fixture file path needs to be relative to `file_fixture_path` instead, this change
10
+ # was brought in with a deprecation warning on 6.1. In Rails 7.0 expect to rework this to remove
11
11
  # the old accessor.
12
- if ::Rails.version.to_f >= 6.1
13
- def rails_fixture_file_wrapper
14
- RailsFixtureFileWrapper.file_fixture_path = nil
15
- resolved_fixture_path =
16
- if respond_to?(:file_fixture_path) && !file_fixture_path.nil?
17
- file_fixture_path.to_s
18
- else
19
- (RSpec.configuration.fixture_path || '').to_s
20
- end
21
- RailsFixtureFileWrapper.file_fixture_path = File.join(resolved_fixture_path, '') unless resolved_fixture_path.strip.empty?
22
- RailsFixtureFileWrapper.instance
23
- end
24
- else
25
- def rails_fixture_file_wrapper
26
- RailsFixtureFileWrapper.fixture_path = nil
27
- resolved_fixture_path =
28
- if respond_to?(:fixture_path) && !fixture_path.nil?
29
- fixture_path.to_s
30
- else
31
- (RSpec.configuration.fixture_path || '').to_s
32
- end
33
- RailsFixtureFileWrapper.fixture_path = File.join(resolved_fixture_path, '') unless resolved_fixture_path.strip.empty?
34
- RailsFixtureFileWrapper.instance
35
- end
12
+ def rails_fixture_file_wrapper
13
+ RailsFixtureFileWrapper.file_fixture_path = nil
14
+ resolved_fixture_path =
15
+ if respond_to?(:file_fixture_path) && !file_fixture_path.nil?
16
+ file_fixture_path.to_s
17
+ else
18
+ (RSpec.configuration.fixture_path || '').to_s
19
+ end
20
+ RailsFixtureFileWrapper.file_fixture_path = File.join(resolved_fixture_path, '') unless resolved_fixture_path.strip.empty?
21
+ RailsFixtureFileWrapper.instance
36
22
  end
37
23
 
38
24
  class RailsFixtureFileWrapper
39
25
  include ActionDispatch::TestProcess if defined?(ActionDispatch::TestProcess)
40
-
41
- if ::Rails.version.to_f >= 6.1
42
- include ActiveSupport::Testing::FileFixtures
43
- end
26
+ include ActiveSupport::Testing::FileFixtures
44
27
 
45
28
  class << self
46
29
  attr_accessor :fixture_path
@@ -46,7 +46,7 @@ module RSpec
46
46
  def proxy_method_warning_if_called_in_before_context_scope(method_name)
47
47
  orig_implementation = instance_method(method_name)
48
48
  define_method(method_name) do |*args, &blk|
49
- if inspect.include?("before(:context)")
49
+ if RSpec.current_scope == :before_context_hook
50
50
  RSpec.warn_with("Calling fixture method in before :context ")
51
51
  else
52
52
  orig_implementation.bind(self).call(*args, &blk)
@@ -159,7 +159,7 @@ module RSpec
159
159
  def check_channel_presence
160
160
  return if @channel.present? && @channel.respond_to?(:channel_name)
161
161
 
162
- error_msg = "Broadcasting channel can't be infered. Please, specify it with `from_channel`"
162
+ error_msg = "Broadcasting channel can't be inferred. Please, specify it with `from_channel`"
163
163
  raise ArgumentError, error_msg
164
164
  end
165
165
  end
@@ -181,7 +181,7 @@ module RSpec
181
181
  |`Time.current.change(usec: 0)`
182
182
  |
183
183
  |Note: RSpec cannot do this for you because jobs can be scheduled with usec
184
- |precision and we do not know wether it is on purpose or not.
184
+ |precision and we do not know whether it is on purpose or not.
185
185
  |
186
186
  |
187
187
  WARNING
@@ -134,7 +134,7 @@ module RSpec
134
134
  end
135
135
 
136
136
  # Ruby 3.1 changed how params were serialized on Rails 6.1
137
- # so we override the active job implementation and customise it here.
137
+ # so we override the active job implementation and customize it here.
138
138
  def deserialize_arguments(job)
139
139
  args = super
140
140
 
@@ -158,7 +158,7 @@ module RSpec
158
158
  end
159
159
 
160
160
  def legacy_mail?(job)
161
- job[:job] <= ActionMailer::DeliveryJob
161
+ RSpec::Rails::FeatureCheck.has_action_mailer_legacy_delivery_job? && job[:job] <= ActionMailer::DeliveryJob
162
162
  end
163
163
 
164
164
  def parameterized_mail?(job)
@@ -169,6 +169,7 @@ module RSpec
169
169
  RSpec::Rails::FeatureCheck.has_action_mailer_unified_delivery? && job[:job] <= ActionMailer::MailDeliveryJob
170
170
  end
171
171
  end
172
+
172
173
  # @api public
173
174
  # Passes if an email has been enqueued inside block.
174
175
  # May chain with to specify expected arguments.
@@ -305,7 +305,7 @@ module RSpec
305
305
 
306
306
  private
307
307
 
308
- # @return [String] formating the expected status and associated code(s)
308
+ # @return [String] formatting the expected status and associated code(s)
309
309
  def type_message
310
310
  @type_message ||= (expected == :error ? "an error" : "a #{expected}") +
311
311
  " status code (#{type_codes})"
@@ -26,7 +26,7 @@ module RSpec
26
26
  path, query = *verb_to_path_map.values.first.split('?')
27
27
  @scope.assert_recognizes(
28
28
  @expected,
29
- {method: verb_to_path_map.keys.first, path: path},
29
+ { method: verb_to_path_map.keys.first, path: path },
30
30
  Rack::Utils.parse_nested_query(query)
31
31
  )
32
32
  end
@@ -115,7 +115,7 @@ module RSpec
115
115
  # Shorthand method for matching this type of route.
116
116
  %w[get post put patch delete options head].each do |method|
117
117
  define_method method do |path|
118
- {method.to_sym => path}
118
+ { method.to_sym => path }
119
119
  end
120
120
  end
121
121
  end
@@ -12,9 +12,7 @@ if defined?(Capybara)
12
12
  RSpec.configure do |c|
13
13
  if defined?(Capybara::DSL)
14
14
  c.include Capybara::DSL, type: :feature
15
- if defined?(ActionPack) && ActionPack::VERSION::STRING >= "5.1"
16
- c.include Capybara::DSL, type: :system
17
- end
15
+ c.include Capybara::DSL, type: :system
18
16
  end
19
17
 
20
18
  if defined?(Capybara::RSpecMatchers)
@@ -3,7 +3,7 @@ module RSpec
3
3
  # Version information for RSpec Rails.
4
4
  module Version
5
5
  # Current version of RSpec Rails, in semantic versioning format.
6
- STRING = '5.1.2'
6
+ STRING = '6.0.1'
7
7
  end
8
8
  end
9
9
  end
@@ -13,26 +13,8 @@ module RSpec
13
13
  end
14
14
 
15
15
  # Compat-shim for AbstractController::Rendering#view_assigns
16
- #
17
- # _assigns was deprecated in favor of view_assigns after
18
- # Rails-3.0.0 was released. Since we are not able to predict when
19
- # the _assigns/view_assigns patch will be released (I thought it
20
- # would have been in 3.0.1, but 3.0.1 bypassed this change for a
21
- # security fix), this bit ensures that we do the right thing without
22
- # knowing anything about the Rails version we are dealing with.
23
- #
24
- # Once that change _is_ released, this can be changed to something
25
- # that checks for the Rails version when the module is being
26
- # interpreted, as it was before commit dd0095.
27
16
  def view_assigns
28
17
  super.merge(_encapsulated_assigns)
29
- rescue
30
- _assigns
31
- end
32
-
33
- # @private
34
- def _assigns
35
- super.merge(_encapsulated_assigns)
36
18
  end
37
19
 
38
20
  private
@@ -62,14 +62,8 @@ module RSpec
62
62
  end
63
63
  end
64
64
 
65
- if ::Rails::VERSION::STRING >= '6'
66
- def self.template_format(template)
67
- template.format
68
- end
69
- else
70
- def self.template_format(template)
71
- template.formats
72
- end
65
+ def self.template_format(template)
66
+ template.format
73
67
  end
74
68
 
75
69
  # Delegates all methods to the submitted resolver and for all methods
data/lib/rspec-rails.rb CHANGED
@@ -8,11 +8,7 @@ module RSpec
8
8
  class Railtie < ::Rails::Railtie
9
9
  # As of Rails 5.1.0 you can register directories to work with `rake notes`
10
10
  require 'rails/source_annotation_extractor'
11
- if ::Rails::VERSION::STRING >= '6.0'
12
- ::Rails::SourceAnnotationExtractor::Annotation.register_directories("spec")
13
- else
14
- SourceAnnotationExtractor::Annotation.register_directories("spec")
15
- end
11
+ ::Rails::SourceAnnotationExtractor::Annotation.register_directories("spec")
16
12
  generators = config.app_generators
17
13
  generators.integration_tool :rspec
18
14
  generators.test_framework :rspec
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.2
4
+ version: 6.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Chelimsky
@@ -44,7 +44,7 @@ cert_chain:
44
44
  ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
45
45
  F3MdtaDehhjC
46
46
  -----END CERTIFICATE-----
47
- date: 2022-04-24 00:00:00.000000000 Z
47
+ date: 2022-10-18 00:00:00.000000000 Z
48
48
  dependencies:
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: actionpack
@@ -52,98 +52,98 @@ dependencies:
52
52
  requirements:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: '5.2'
55
+ version: '6.1'
56
56
  type: :runtime
57
57
  prerelease: false
58
58
  version_requirements: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: '5.2'
62
+ version: '6.1'
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: activesupport
65
65
  requirement: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: '5.2'
69
+ version: '6.1'
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - ">="
75
75
  - !ruby/object:Gem::Version
76
- version: '5.2'
76
+ version: '6.1'
77
77
  - !ruby/object:Gem::Dependency
78
78
  name: railties
79
79
  requirement: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - ">="
82
82
  - !ruby/object:Gem::Version
83
- version: '5.2'
83
+ version: '6.1'
84
84
  type: :runtime
85
85
  prerelease: false
86
86
  version_requirements: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - ">="
89
89
  - !ruby/object:Gem::Version
90
- version: '5.2'
90
+ version: '6.1'
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rspec-core
93
93
  requirement: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '3.10'
97
+ version: '3.11'
98
98
  type: :runtime
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: '3.10'
104
+ version: '3.11'
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: rspec-expectations
107
107
  requirement: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: '3.10'
111
+ version: '3.11'
112
112
  type: :runtime
113
113
  prerelease: false
114
114
  version_requirements: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - "~>"
117
117
  - !ruby/object:Gem::Version
118
- version: '3.10'
118
+ version: '3.11'
119
119
  - !ruby/object:Gem::Dependency
120
120
  name: rspec-mocks
121
121
  requirement: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - "~>"
124
124
  - !ruby/object:Gem::Version
125
- version: '3.10'
125
+ version: '3.11'
126
126
  type: :runtime
127
127
  prerelease: false
128
128
  version_requirements: !ruby/object:Gem::Requirement
129
129
  requirements:
130
130
  - - "~>"
131
131
  - !ruby/object:Gem::Version
132
- version: '3.10'
132
+ version: '3.11'
133
133
  - !ruby/object:Gem::Dependency
134
134
  name: rspec-support
135
135
  requirement: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - "~>"
138
138
  - !ruby/object:Gem::Version
139
- version: '3.10'
139
+ version: '3.11'
140
140
  type: :runtime
141
141
  prerelease: false
142
142
  version_requirements: !ruby/object:Gem::Requirement
143
143
  requirements:
144
144
  - - "~>"
145
145
  - !ruby/object:Gem::Version
146
- version: '3.10'
146
+ version: '3.11'
147
147
  - !ruby/object:Gem::Dependency
148
148
  name: ammeter
149
149
  requirement: !ruby/object:Gem::Requirement
@@ -176,28 +176,16 @@ dependencies:
176
176
  name: cucumber
177
177
  requirement: !ruby/object:Gem::Requirement
178
178
  requirements:
179
- - - ">="
180
- - !ruby/object:Gem::Version
181
- version: '3.2'
182
- - - "!="
183
- - !ruby/object:Gem::Version
184
- version: 4.0.0
185
- - - "<"
179
+ - - "~>"
186
180
  - !ruby/object:Gem::Version
187
- version: 8.0.0
181
+ version: '7.0'
188
182
  type: :development
189
183
  prerelease: false
190
184
  version_requirements: !ruby/object:Gem::Requirement
191
185
  requirements:
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- version: '3.2'
195
- - - "!="
196
- - !ruby/object:Gem::Version
197
- version: 4.0.0
198
- - - "<"
186
+ - - "~>"
199
187
  - !ruby/object:Gem::Version
200
- version: 8.0.0
188
+ version: '7.0'
201
189
  description: rspec-rails is a testing framework for Rails 5+.
202
190
  email: rspec@googlegroups.com
203
191
  executables: []
@@ -228,7 +216,6 @@ files:
228
216
  - lib/generators/rspec/install/install_generator.rb
229
217
  - lib/generators/rspec/install/templates/spec/rails_helper.rb
230
218
  - lib/generators/rspec/integration/integration_generator.rb
231
- - lib/generators/rspec/integration/templates/request_spec.rb
232
219
  - lib/generators/rspec/job/job_generator.rb
233
220
  - lib/generators/rspec/job/templates/job_spec.rb.erb
234
221
  - lib/generators/rspec/mailbox/mailbox_generator.rb
@@ -241,6 +228,7 @@ files:
241
228
  - lib/generators/rspec/model/templates/fixtures.yml
242
229
  - lib/generators/rspec/model/templates/model_spec.rb
243
230
  - lib/generators/rspec/request/request_generator.rb
231
+ - lib/generators/rspec/request/templates/request_spec.rb
244
232
  - lib/generators/rspec/scaffold/scaffold_generator.rb
245
233
  - lib/generators/rspec/scaffold/templates/api_controller_spec.rb
246
234
  - lib/generators/rspec/scaffold/templates/api_request_spec.rb
@@ -308,7 +296,7 @@ licenses:
308
296
  - MIT
309
297
  metadata:
310
298
  bug_tracker_uri: https://github.com/rspec/rspec-rails/issues
311
- changelog_uri: https://github.com/rspec/rspec-rails/blob/v5.1.2/Changelog.md
299
+ changelog_uri: https://github.com/rspec/rspec-rails/blob/v6.0.1/Changelog.md
312
300
  documentation_uri: https://rspec.info/documentation/
313
301
  mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
314
302
  source_code_uri: https://github.com/rspec/rspec-rails
@@ -321,7 +309,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
321
309
  requirements:
322
310
  - - ">="
323
311
  - !ruby/object:Gem::Version
324
- version: 2.2.0
312
+ version: 2.5.0
325
313
  required_rubygems_version: !ruby/object:Gem::Requirement
326
314
  requirements:
327
315
  - - ">="
metadata.gz.sig CHANGED
Binary file