rspec-rails 6.1.2 → 7.1.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.
@@ -33,7 +33,7 @@ module RSpec
33
33
  # @param obj [Object] object to convert to a response
34
34
  # @return [ActionDispatch::TestResponse]
35
35
  def as_test_response(obj)
36
- if ::ActionDispatch::Response === obj
36
+ if ::ActionDispatch::Response === obj || ::Rack::MockResponse === obj
37
37
  ::ActionDispatch::TestResponse.from_response(obj)
38
38
  elsif ::ActionDispatch::TestResponse === obj
39
39
  obj
@@ -216,11 +216,7 @@ module RSpec
216
216
  # @see Rack::Utils::SYMBOL_TO_STATUS_CODE
217
217
  # @raise [ArgumentError] if an associated code could not be found
218
218
  def set_expected_code!
219
- @expected ||=
220
- Rack::Utils::SYMBOL_TO_STATUS_CODE.fetch(expected_status) do
221
- raise ArgumentError,
222
- "Invalid HTTP status: #{expected_status.inspect}"
223
- end
219
+ @expected ||= Rack::Utils.status_code(expected_status)
224
220
  end
225
221
  end
226
222
 
@@ -237,7 +233,7 @@ module RSpec
237
233
  # expect(response).to have_http_status(:redirect)
238
234
  #
239
235
  # @see RSpec::Rails::Matchers#have_http_status
240
- # @see https://github.com/rails/rails/blob/6-0-stable/actionpack/lib/action_dispatch/testing/test_response.rb `ActionDispatch::TestResponse`
236
+ # @see https://github.com/rails/rails/blob/7-2-stable/actionpack/lib/action_dispatch/testing/test_response.rb `ActionDispatch::TestResponse`
241
237
  class GenericStatus < RSpec::Rails::Matchers::BaseMatcher
242
238
  include HaveHttpStatus
243
239
 
@@ -5,7 +5,9 @@ end
5
5
 
6
6
  task default: :spec
7
7
 
8
- task stats: "spec:statsetup"
8
+ if ::Rails::VERSION::STRING < "8.0.0"
9
+ task stats: "spec:statsetup"
10
+ end
9
11
 
10
12
  desc "Run all specs in spec directory (excluding plugin specs)"
11
13
  RSpec::Core::RakeTask.new(spec: "spec:prepare")
@@ -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 = '6.1.2'
6
+ STRING = '7.1.1'
7
7
  end
8
8
  end
9
9
  end
data/lib/rspec-rails.rb CHANGED
@@ -9,6 +9,23 @@ module RSpec
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
11
  ::Rails::SourceAnnotationExtractor::Annotation.register_directories("spec")
12
+
13
+ # As of Rails 8.0.0 you can register directories to work with `rails stats`
14
+ if ::Rails::VERSION::STRING >= "8.0.0"
15
+ require 'rails/code_statistics'
16
+
17
+ dirs = Dir['./spec/**/*_spec.rb']
18
+ .map { |f| f.sub(/^\.\/(spec\/\w+)\/.*/, '\\1') }
19
+ .uniq
20
+ .select { |f| File.directory?(f) }
21
+
22
+ Hash[dirs.map { |d| [d.split('/').last, d] }].each do |type, dir|
23
+ name = type.singularize.capitalize
24
+
25
+ ::Rails::CodeStatistics.register_directory "#{name} specs", dir, test_directory: true
26
+ end
27
+ end
28
+
12
29
  generators = config.app_generators
13
30
  generators.integration_tool :rspec
14
31
  generators.test_framework :rspec
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,21 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.2
4
+ version: 7.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Chelimsky
8
8
  - Andy Lindeman
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain:
12
11
  - |
13
12
  -----BEGIN CERTIFICATE-----
14
- MIIF1TCCA72gAwIBAgIJAPXjfUbCjdXUMA0GCSqGSIb3DQEBBQUAMIGAMQswCQYD
13
+ MIIFvjCCA6agAwIBAgIJAPXjfUbCjdXVMA0GCSqGSIb3DQEBCwUAMIGAMQswCQYD
15
14
  VQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjEQMA4GA1UEBwwHU2VhdHR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RNJig3Y8qPjocZR0cGkhgZoC9wribWxHSNawZm4CoV3fja2HNx9QyM7BaB+as
38
+ yuqAiBbA7vBcyc8nKATip3mxbyXYXoDD7nmO8JCPP7O/WsgG+U/B2a0kPdvYFoxE
39
+ Q0Js3GtFCuMvL+0rifqdxBOLtu0Pw9q4RvToTJIl2IR6eTgCb82B1hw9qKf7PjuL
40
+ BoEsYjjDhGw6FZvcJG8O6uj7aB+z4aF21YR74UGL7sq/RIPNNez5JI95jTGfqCPy
41
+ 6yo0w3zja3yg28QK3Fj+tbOHeSLv9SDQWi/1jiPprGzbxGvbVvjvX11YZc46vkmY
42
+ AwP+qZPPf97FXXZGEGIYhhHpnj+Ltx9nCetRPiZ4rvYBcXgCWVQSg6eiEofrMwn/
43
+ AKMCABhZ1Y2eATsfMgdkmIZk7JIPZiSi6eUxPiCMP9M/pw==
46
44
  -----END CERTIFICATE-----
47
- date: 2024-03-18 00:00:00.000000000 Z
45
+ date: 2025-02-06 00:00:00.000000000 Z
48
46
  dependencies:
49
47
  - !ruby/object:Gem::Dependency
50
48
  name: actionpack
@@ -52,42 +50,42 @@ dependencies:
52
50
  requirements:
53
51
  - - ">="
54
52
  - !ruby/object:Gem::Version
55
- version: '6.1'
53
+ version: '7.0'
56
54
  type: :runtime
57
55
  prerelease: false
58
56
  version_requirements: !ruby/object:Gem::Requirement
59
57
  requirements:
60
58
  - - ">="
61
59
  - !ruby/object:Gem::Version
62
- version: '6.1'
60
+ version: '7.0'
63
61
  - !ruby/object:Gem::Dependency
64
62
  name: activesupport
65
63
  requirement: !ruby/object:Gem::Requirement
66
64
  requirements:
67
65
  - - ">="
68
66
  - !ruby/object:Gem::Version
69
- version: '6.1'
67
+ version: '7.0'
70
68
  type: :runtime
71
69
  prerelease: false
72
70
  version_requirements: !ruby/object:Gem::Requirement
73
71
  requirements:
74
72
  - - ">="
75
73
  - !ruby/object:Gem::Version
76
- version: '6.1'
74
+ version: '7.0'
77
75
  - !ruby/object:Gem::Dependency
78
76
  name: railties
79
77
  requirement: !ruby/object:Gem::Requirement
80
78
  requirements:
81
79
  - - ">="
82
80
  - !ruby/object:Gem::Version
83
- version: '6.1'
81
+ version: '7.0'
84
82
  type: :runtime
85
83
  prerelease: false
86
84
  version_requirements: !ruby/object:Gem::Requirement
87
85
  requirements:
88
86
  - - ">="
89
87
  - !ruby/object:Gem::Version
90
- version: '6.1'
88
+ version: '7.0'
91
89
  - !ruby/object:Gem::Dependency
92
90
  name: rspec-core
93
91
  requirement: !ruby/object:Gem::Requirement
@@ -176,17 +174,17 @@ dependencies:
176
174
  name: cucumber
177
175
  requirement: !ruby/object:Gem::Requirement
178
176
  requirements:
179
- - - "~>"
177
+ - - ">"
180
178
  - !ruby/object:Gem::Version
181
179
  version: '7.0'
182
180
  type: :development
183
181
  prerelease: false
184
182
  version_requirements: !ruby/object:Gem::Requirement
185
183
  requirements:
186
- - - "~>"
184
+ - - ">"
187
185
  - !ruby/object:Gem::Version
188
186
  version: '7.0'
189
- description: rspec-rails is a testing framework for Rails 5+.
187
+ description: rspec-rails integrates the Rails testing helpers into RSpec.
190
188
  email: rspec@googlegroups.com
191
189
  executables: []
192
190
  extensions: []
@@ -215,7 +213,6 @@ files:
215
213
  - lib/generators/rspec/helper/templates/helper_spec.rb
216
214
  - lib/generators/rspec/install/install_generator.rb
217
215
  - lib/generators/rspec/install/templates/spec/rails_helper.rb
218
- - lib/generators/rspec/integration/integration_generator.rb
219
216
  - lib/generators/rspec/job/job_generator.rb
220
217
  - lib/generators/rspec/job/templates/job_spec.rb.erb
221
218
  - lib/generators/rspec/mailbox/mailbox_generator.rb
@@ -297,11 +294,10 @@ licenses:
297
294
  - MIT
298
295
  metadata:
299
296
  bug_tracker_uri: https://github.com/rspec/rspec-rails/issues
300
- changelog_uri: https://github.com/rspec/rspec-rails/blob/v6.1.2/Changelog.md
297
+ changelog_uri: https://github.com/rspec/rspec-rails/blob/v7.1.1/Changelog.md
301
298
  documentation_uri: https://rspec.info/documentation/
302
299
  mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
303
300
  source_code_uri: https://github.com/rspec/rspec-rails
304
- post_install_message:
305
301
  rdoc_options:
306
302
  - "--charset=UTF-8"
307
303
  require_paths:
@@ -310,15 +306,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
310
306
  requirements:
311
307
  - - ">="
312
308
  - !ruby/object:Gem::Version
313
- version: 2.5.0
309
+ version: 2.7.0
314
310
  required_rubygems_version: !ruby/object:Gem::Requirement
315
311
  requirements:
316
312
  - - ">="
317
313
  - !ruby/object:Gem::Version
318
314
  version: '0'
319
315
  requirements: []
320
- rubygems_version: 3.5.6
321
- signing_key:
316
+ rubygems_version: 3.6.2
322
317
  specification_version: 4
323
318
  summary: RSpec for Rails
324
319
  test_files: []
metadata.gz.sig CHANGED
Binary file
@@ -1,29 +0,0 @@
1
- require 'generators/rspec'
2
- require 'rspec/core/warnings'
3
-
4
- module Rspec
5
- module Generators
6
- # @private
7
- class IntegrationGenerator < Base
8
- class_option :request_specs,
9
- type: :boolean,
10
- default: true,
11
- desc: "Generate request specs"
12
-
13
- source_paths << File.expand_path('../request/templates', __dir__)
14
-
15
- def generate_request_spec
16
- return unless options[:request_specs]
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
-
24
- template 'request_spec.rb',
25
- target_path('requests', "#{name.underscore.pluralize}_spec.rb")
26
- end
27
- end
28
- end
29
- end