rspec-rails 7.0.2 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/Changelog.md +13 -1
- data/README.md +1 -1
- data/lib/generators/rspec/install/templates/spec/rails_helper.rb +10 -8
- data/lib/rspec/rails/matchers/action_cable/have_broadcasted_to.rb +10 -3
- data/lib/rspec/rails/matchers/action_cable.rb +6 -1
- data/lib/rspec/rails/matchers/active_job.rb +7 -0
- data/lib/rspec/rails/matchers/have_enqueued_mail.rb +1 -0
- data/lib/rspec/rails/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 725cbfd52d9f763648a595bba0a46d7c0905548e04b988f7c451a0b23ec5e283
|
4
|
+
data.tar.gz: ae2f038303eca35e63674c059e4ebe3b3788c47e52bd397ed67c5b857b8f2e19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3949cffce869076c1b3d84806c76ce5c609b8ae7cc5cd906b44ed09d8df3be4c7d7603c4a2d0430d2337fe7d828b8879025bf32fcacecbb2da010f2108949479
|
7
|
+
data.tar.gz: 0a9c1d5d4968a49d52d6d68078761241431a28c8e2f023d3228536839c7a550d637996b050fbc771f475cc2b3951f0846be429a31fba9d124138f3d8b67d66e3
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
### Development
|
2
|
-
[Full Changelog](https://github.com/rspec/rspec-rails/compare/v7.0
|
2
|
+
[Full Changelog](https://github.com/rspec/rspec-rails/compare/v7.1.0...7-1-maintenance)
|
3
|
+
|
4
|
+
### 7.1.0 / 2024-11-09
|
5
|
+
[Full Changelog](https://github.com/rspec/rspec-rails/compare/v7.0.2...v7.1.0)
|
6
|
+
|
7
|
+
Enhancements:
|
8
|
+
|
9
|
+
* Improve implicit description for ActionCable matchers `have_broadcasted_to` /
|
10
|
+
`have_broadcast`. (Simon Fish, #2795)
|
11
|
+
* Comment out `infer_spec_type_from_file_location!` in newly generated
|
12
|
+
`rails_helper.rb` files. (Jon Rowe, #2804)
|
13
|
+
* Allow turning off active job / mailer argument validation.
|
14
|
+
(Oli Peate, #2808)
|
3
15
|
|
4
16
|
### 7.0.2 / 2024-11-09
|
5
17
|
[Full Changelog](https://github.com/rspec/rspec-rails/compare/v7.0.1...v7.0.2)
|
data/README.md
CHANGED
@@ -32,7 +32,7 @@ According to [RSpec Rails new versioning strategy][] use:
|
|
32
32
|
|
33
33
|
## Installation
|
34
34
|
|
35
|
-
**IMPORTANT** This README / branch refers to the 7.
|
35
|
+
**IMPORTANT** This README / branch refers to the 7.1.x stable release series, only bugfixes from this series will
|
36
36
|
be added here. See the [`main` branch on Github](https://github.com/rspec/rspec-rails/tree/main) if you want or
|
37
37
|
require the latest unstable features.
|
38
38
|
|
@@ -67,20 +67,22 @@ RSpec.configure do |config|
|
|
67
67
|
# config.use_transactional_fixtures = true
|
68
68
|
|
69
69
|
<% end -%>
|
70
|
-
# RSpec Rails
|
71
|
-
#
|
72
|
-
# `post` in specs under `spec/controllers`.
|
70
|
+
# RSpec Rails uses metadata to mix in different behaviours to your tests,
|
71
|
+
# for example enabling you to call `get` and `post` in request specs. e.g.:
|
73
72
|
#
|
74
|
-
#
|
75
|
-
# explicitly tag your specs with their type, e.g.:
|
76
|
-
#
|
77
|
-
# RSpec.describe UsersController, type: :controller do
|
73
|
+
# RSpec.describe UsersController, type: :request do
|
78
74
|
# # ...
|
79
75
|
# end
|
80
76
|
#
|
81
77
|
# The different available types are documented in the features, such as in
|
82
78
|
# https://rspec.info/features/7-0/rspec-rails
|
83
|
-
|
79
|
+
#
|
80
|
+
# You can also this infer these behaviours automatically by location, e.g.
|
81
|
+
# /spec/models would pull in the same behaviour as `type: :model` but this
|
82
|
+
# behaviour is considered legacy and will be removed in a future version.
|
83
|
+
#
|
84
|
+
# To enable this behaviour uncomment the line below.
|
85
|
+
# config.infer_spec_type_from_file_location!
|
84
86
|
|
85
87
|
# Filter lines from Rails gems in backtraces.
|
86
88
|
config.filter_rails_from_backtrace!
|
@@ -51,6 +51,10 @@ module RSpec
|
|
51
51
|
exactly(:thrice)
|
52
52
|
end
|
53
53
|
|
54
|
+
def description
|
55
|
+
"have broadcasted #{base_description}"
|
56
|
+
end
|
57
|
+
|
54
58
|
def failure_message
|
55
59
|
"expected to broadcast #{base_message}".tap do |msg|
|
56
60
|
if @unmatching_msgs.any?
|
@@ -140,18 +144,21 @@ module RSpec
|
|
140
144
|
end
|
141
145
|
end
|
142
146
|
|
143
|
-
def
|
147
|
+
def base_description
|
144
148
|
"#{message_expectation_modifier} #{@expected_number} messages to #{stream}".tap do |msg|
|
145
149
|
msg << " with #{data_description(@data)}" unless @data.nil?
|
146
|
-
msg << ", but broadcast #{@matching_msgs_count}"
|
147
150
|
end
|
148
151
|
end
|
149
152
|
|
153
|
+
def base_message
|
154
|
+
"#{base_description}, but broadcast #{@matching_msgs_count}"
|
155
|
+
end
|
156
|
+
|
150
157
|
def data_description(data)
|
151
158
|
if data.is_a?(RSpec::Matchers::Composable)
|
152
159
|
data.description
|
153
160
|
else
|
154
|
-
data
|
161
|
+
data.inspect
|
155
162
|
end
|
156
163
|
end
|
157
164
|
|
@@ -3,6 +3,8 @@ require "rspec/rails/matchers/action_cable/have_broadcasted_to"
|
|
3
3
|
module RSpec
|
4
4
|
module Rails
|
5
5
|
module Matchers
|
6
|
+
extend RSpec::Matchers::DSL
|
7
|
+
|
6
8
|
# Namespace for various implementations of ActionCable features
|
7
9
|
#
|
8
10
|
# @api private
|
@@ -50,7 +52,10 @@ module RSpec
|
|
50
52
|
|
51
53
|
ActionCable::HaveBroadcastedTo.new(target, channel: described_class)
|
52
54
|
end
|
53
|
-
|
55
|
+
|
56
|
+
alias_matcher :broadcast_to, :have_broadcasted_to do |desc|
|
57
|
+
desc.gsub("have broadcasted", "broadcast")
|
58
|
+
end
|
54
59
|
|
55
60
|
private
|
56
61
|
|
@@ -178,6 +178,8 @@ module RSpec
|
|
178
178
|
end
|
179
179
|
|
180
180
|
def detect_args_signature_mismatch(jobs)
|
181
|
+
return if skip_signature_verification?
|
182
|
+
|
181
183
|
jobs.each do |job|
|
182
184
|
args = deserialize_arguments(job)
|
183
185
|
|
@@ -189,6 +191,11 @@ module RSpec
|
|
189
191
|
nil
|
190
192
|
end
|
191
193
|
|
194
|
+
def skip_signature_verification?
|
195
|
+
!RSpec::Mocks.configuration.verify_partial_doubles? ||
|
196
|
+
RSpec::Mocks.configuration.temporarily_suppress_partial_double_verification
|
197
|
+
end
|
198
|
+
|
192
199
|
def check_args_signature_mismatch(job_class, job_method, args)
|
193
200
|
signature = Support::MethodSignature.new(job_class.public_instance_method(job_method))
|
194
201
|
verifier = Support::StrictSignatureVerifier.new(signature, args)
|
data/lib/rspec/rails/version.rb
CHANGED
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: 7.0
|
4
|
+
version: 7.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Chelimsky
|
@@ -296,7 +296,7 @@ licenses:
|
|
296
296
|
- MIT
|
297
297
|
metadata:
|
298
298
|
bug_tracker_uri: https://github.com/rspec/rspec-rails/issues
|
299
|
-
changelog_uri: https://github.com/rspec/rspec-rails/blob/v7.0
|
299
|
+
changelog_uri: https://github.com/rspec/rspec-rails/blob/v7.1.0/Changelog.md
|
300
300
|
documentation_uri: https://rspec.info/documentation/
|
301
301
|
mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
|
302
302
|
source_code_uri: https://github.com/rspec/rspec-rails
|
metadata.gz.sig
CHANGED
Binary file
|