rspec-rails 6.0.1 → 6.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/Changelog.md +37 -4
- data/README.md +29 -31
- data/lib/generators/rspec/install/templates/spec/rails_helper.rb +1 -1
- data/lib/generators/rspec/scaffold/templates/edit_spec.rb +3 -3
- data/lib/generators/rspec/scaffold/templates/new_spec.rb +1 -1
- data/lib/generators/rspec/scaffold/templates/show_spec.rb +1 -1
- data/lib/rspec/rails/example/rails_example_group.rb +8 -1
- data/lib/rspec/rails/example/system_example_group.rb +46 -0
- data/lib/rspec/rails/example/view_example_group.rb +1 -1
- data/lib/rspec/rails/file_fixture_support.rb +3 -0
- data/lib/rspec/rails/fixture_support.rb +42 -15
- data/lib/rspec/rails/matchers/action_cable/have_broadcasted_to.rb +5 -2
- data/lib/rspec/rails/matchers/active_job.rb +3 -3
- data/lib/rspec/rails/version.rb +1 -1
- data/lib/rspec/rails/view_rendering.rb +11 -3
- data.tar.gz.sig +0 -0
- metadata +15 -15
- 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: ecae469592630a6ecaaa39d6f2be0e2616cb2079c044bc390e548956b823d6bc
|
4
|
+
data.tar.gz: f24952e5edf9bf57f6e8c94fced8c7b2d38938b4a1b250fa83043bf316c8de9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e50c692c774cd0a874bedd667e7c0e3997236d43a74750efb6cc215a3019ce9a4babc5437a79825c43c885b70f1c3da9c90599ce1b0bf123ba1538e77cc7884e
|
7
|
+
data.tar.gz: a148f034a8667af85e68c478849bd9ea33443567dec01335d0a83ad9fd44d63d7dd0780694ebaee55f2278add2fefa61032674e38dec865cf01ee1205e13d1e9
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,15 +1,48 @@
|
|
1
|
-
###
|
2
|
-
[Full Changelog](https://github.com/rspec/rspec-rails/compare/v6.0.
|
1
|
+
### 6.0.4 / 2023-11-21
|
2
|
+
[Full Changelog](https://github.com/rspec/rspec-rails/compare/v6.0.3...v6.0.4)
|
3
|
+
|
4
|
+
Bug Fixes:
|
5
|
+
|
6
|
+
* Fuzzy match `have_broadcasted_to` so that argument matchers can be used.
|
7
|
+
(Timothy Peraza, #2684)
|
8
|
+
* Fix fixture warning during `:context` hooks on Rails `main`. (Jon Rowe, #2685)
|
9
|
+
* Fix `stub_template` on Rails `main`. (Jon Rowe, #2685)
|
10
|
+
* Fix variable name in scaffolded view specs when namespaced. (Taketo Takashima, #2694)
|
11
|
+
* Prevent `take_failed_screenshot` producing an additional error through `metadata`
|
12
|
+
access. (Jon Rowe, #2704)
|
13
|
+
* Use `ActiveSupport::ExecutionContext::TestHelper` on Rails 7+. (Jon Rowe, #2711)
|
14
|
+
* Fix leak of templates stubbed with `stub_template` on Rails 7.1. (Jon Rowe, #2714)
|
15
|
+
|
16
|
+
### 6.0.3 / 2023-05-31
|
17
|
+
[Full Changelog](https://github.com/rspec/rspec-rails/compare/v6.0.2...v6.0.3)
|
18
|
+
|
19
|
+
Bug Fixes:
|
20
|
+
|
21
|
+
* Set `ActiveStorage::FixtureSet.file_fixture_path` when including file fixture support.
|
22
|
+
(Jason Yates, #2671)
|
23
|
+
* Allow `broadcast_to` matcher to take Symbols. (@Vagab, #2680)
|
24
|
+
|
25
|
+
### 6.0.2 / 2023-05-04
|
26
|
+
[Full Changelog](https://github.com/rspec/rspec-rails/compare/v6.0.1...v6.0.2)
|
27
|
+
|
28
|
+
Bug Fixes:
|
29
|
+
|
30
|
+
* Fix ActionView::PathSet when `render_views` is off for Rails 7.1.
|
31
|
+
(Eugene Kenny, Iliana, #2631)
|
32
|
+
* Support Rails 7.1's `#fixtures_paths` in example groups (removes a deprecation warning).
|
33
|
+
(Nicholas Simmons, #2664)
|
34
|
+
* Fix `have_enqueued_job` to properly detect enqueued jobs when other jobs were
|
35
|
+
performed inside the expectation block. (Slava Kardakov, Phil Pirozhkov, #2573)
|
3
36
|
|
4
37
|
### 6.0.1 / 2022-10-18
|
5
|
-
[Full Changelog](https://github.com/rspec/rspec-rails/compare/v6.0.0...
|
38
|
+
[Full Changelog](https://github.com/rspec/rspec-rails/compare/v6.0.0...v6.0.1)
|
6
39
|
|
7
40
|
Bug Fixes:
|
8
41
|
|
9
42
|
* Prevent tagged logged support in Rails 7 calling `#name`. (Jon Rowe, #2625)
|
10
43
|
|
11
44
|
### 6.0.0 / 2022-10-10
|
12
|
-
[Full Changelog](https://github.com/rspec/rspec-rails/compare/v5.1.2...
|
45
|
+
[Full Changelog](https://github.com/rspec/rspec-rails/compare/v5.1.2...v6.0.0)
|
13
46
|
|
14
47
|
Enhancements:
|
15
48
|
|
data/README.md
CHANGED
@@ -15,8 +15,6 @@ According to [RSpec Rails new versioning strategy][] use:
|
|
15
15
|
* **[`rspec-rails` 3.x][]** for Rails earlier than 5.0.
|
16
16
|
* **[`rspec-rails` 1.x][]** for Rails 2.x.
|
17
17
|
|
18
|
-
[Build Status]: https://secure.travis-ci.org/rspec/rspec-rails.svg?branch=main
|
19
|
-
[travis-ci]: https://travis-ci.org/rspec/rspec-rails
|
20
18
|
[Code Climate]: https://codeclimate.com/github/rspec/rspec-rails.svg
|
21
19
|
[code-climate]: https://codeclimate.com/github/rspec/rspec-rails
|
22
20
|
[Gem Version]: https://badge.fury.io/rb/rspec-rails.svg
|
@@ -88,8 +86,8 @@ read the [`rspec-rails` upgrade notes][] to find out what to watch out for.
|
|
88
86
|
|
89
87
|
Be sure to check the general [RSpec upgrade notes][] as well.
|
90
88
|
|
91
|
-
[`rspec-rails` upgrade notes]: https://
|
92
|
-
[RSpec upgrade notes]: https://
|
89
|
+
[`rspec-rails` upgrade notes]: https://rspec.info/features/6-0/rspec-rails/upgrade
|
90
|
+
[RSpec upgrade notes]: https://rspec.info/upgrading-from-rspec-2/
|
93
91
|
|
94
92
|
## Usage
|
95
93
|
|
@@ -183,7 +181,7 @@ rspec ./spec/models/post_spec.rb:3 # Post before publication cannot have comment
|
|
183
181
|
For an in-depth look at the RSpec DSL, including lots of examples,
|
184
182
|
read the official Cucumber documentation for [RSpec Core][].
|
185
183
|
|
186
|
-
[RSpec Core]: https://
|
184
|
+
[RSpec Core]: https://rspec.info/features/3-12/rspec-core
|
187
185
|
|
188
186
|
### Helpful Rails Matchers
|
189
187
|
|
@@ -209,23 +207,23 @@ to test the various parts of a Rails system:
|
|
209
207
|
|
210
208
|
Follow the links above for examples of how each matcher is used.
|
211
209
|
|
212
|
-
[the matchers that come standard in RSpec]: https://
|
213
|
-
[`be_a_new`]: https://
|
214
|
-
[`render_template`]: https://
|
215
|
-
[`redirect_to`]: https://
|
216
|
-
[`route_to`]: https://
|
217
|
-
[`be_routable`]: https://
|
218
|
-
[`have_http_status`]: https://
|
219
|
-
[`match_array`]: https://
|
220
|
-
[`have_been_enqueued`]: https://
|
221
|
-
[`have_enqueued_job`]: https://
|
210
|
+
[the matchers that come standard in RSpec]: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers
|
211
|
+
[`be_a_new`]: https://rspec.info/features/6-0/rspec-rails/matchers/new-record-matcher
|
212
|
+
[`render_template`]: https://rspec.info/features/6-0/rspec-rails/matchers/render-template-matcher
|
213
|
+
[`redirect_to`]: https://rspec.info/features/6-0/rspec-rails/matchers/redirect-to-matcher
|
214
|
+
[`route_to`]: https://rspec.info/features/6-0/rspec-rails/routing-specs/route-to-matcher
|
215
|
+
[`be_routable`]: https://rspec.info/features/6-0/rspec-rails/routing-specs/be-routable-matcher
|
216
|
+
[`have_http_status`]: https://rspec.info/features/6-0/rspec-rails/matchers/have-http-status-matcher
|
217
|
+
[`match_array`]: https://rspec.info/features/6-0/rspec-rails/matchers/relation-match-array
|
218
|
+
[`have_been_enqueued`]: https://rspec.info/features/6-0/rspec-rails/matchers/have-been-enqueued-matcher
|
219
|
+
[`have_enqueued_job`]: https://rspec.info/features/6-0/rspec-rails/matchers/have-enqueued-job-matcher
|
222
220
|
|
223
221
|
### What else does RSpec Rails add?
|
224
222
|
|
225
223
|
For a comprehensive look at RSpec Rails’ features,
|
226
224
|
read the [official Cucumber documentation][].
|
227
225
|
|
228
|
-
[official Cucumber documentation]: https://
|
226
|
+
[official Cucumber documentation]: https://rspec.info/features/6-0/rspec-rails
|
229
227
|
|
230
228
|
## What tests should I write?
|
231
229
|
|
@@ -270,20 +268,20 @@ RSpec.describe User, type: :model do
|
|
270
268
|
...
|
271
269
|
```
|
272
270
|
|
273
|
-
[request]: https://
|
274
|
-
[feature]: https://
|
275
|
-
[system]: https://
|
276
|
-
[model]: https://
|
277
|
-
[controller]: https://
|
278
|
-
[mailer]: https://
|
279
|
-
[job]: https://
|
280
|
-
[view]: https://
|
281
|
-
[routing]: https://
|
282
|
-
[helper]: https://
|
271
|
+
[request]: https://rspec.info/features/6-0/rspec-rails/request-specs/request-spec
|
272
|
+
[feature]: https://rspec.info/features/6-0/rspec-rails/feature-specs/feature-spec
|
273
|
+
[system]: https://rspec.info/features/6-0/rspec-rails/system-specs/system-specs
|
274
|
+
[model]: https://rspec.info/features/6-0/rspec-rails/model-specs
|
275
|
+
[controller]: https://rspec.info/features/6-0/rspec-rails/controller-specs
|
276
|
+
[mailer]: https://rspec.info/features/6-0/rspec-rails/mailer-specs
|
277
|
+
[job]: https://rspec.info/features/6-0/rspec-rails/job-specs/job-spec
|
278
|
+
[view]: https://rspec.info/features/6-0/rspec-rails/view-specs/view-spec
|
279
|
+
[routing]: https://rspec.info/features/6-0/rspec-rails/routing-specs
|
280
|
+
[helper]: https://rspec.info/features/6-0/rspec-rails/helper-specs/helper-spec
|
283
281
|
[`ActionDispatch::IntegrationTest`]: https://api.rubyonrails.org/classes/ActionDispatch/IntegrationTest.html
|
284
282
|
[`ActionDispatch::SystemTestCase`]: https://api.rubyonrails.org/classes/ActionDispatch/SystemTestCase.html
|
285
283
|
[`ActionController::TestCase`]: https://api.rubyonrails.org/classes/ActionController/TestCase.html
|
286
|
-
[in the appropriate folder]: https://
|
284
|
+
[in the appropriate folder]: https://rspec.info/features/6-0/rspec-rails/directory-structure
|
287
285
|
|
288
286
|
### System specs, feature specs, request specs–what’s the difference?
|
289
287
|
|
@@ -366,10 +364,10 @@ you can run the specs and Cucumber features, or submit a pull request.
|
|
366
364
|
|
367
365
|
### RSpec base libraries
|
368
366
|
|
369
|
-
*
|
370
|
-
*
|
371
|
-
*
|
372
|
-
*
|
367
|
+
* https://github.com/rspec/rspec
|
368
|
+
* https://github.com/rspec/rspec-core
|
369
|
+
* https://github.com/rspec/rspec-expectations
|
370
|
+
* https://github.com/rspec/rspec-mocks
|
373
371
|
|
374
372
|
### Recommended third-party extensions
|
375
373
|
|
@@ -68,7 +68,7 @@ RSpec.configure do |config|
|
|
68
68
|
# end
|
69
69
|
#
|
70
70
|
# The different available types are documented in the features, such as in
|
71
|
-
# https://
|
71
|
+
# https://rspec.info/features/6-0/rspec-rails
|
72
72
|
config.infer_spec_type_from_file_location!
|
73
73
|
|
74
74
|
# Filter lines from Rails gems in backtraces.
|
@@ -2,7 +2,7 @@ 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
|
-
let(:<%=
|
5
|
+
let(:<%= singular_table_name %>) {
|
6
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 ? '' : ','%>
|
@@ -11,13 +11,13 @@ RSpec.describe "<%= ns_table_name %>/edit", <%= type_metatag(:view) %> do
|
|
11
11
|
}
|
12
12
|
|
13
13
|
before(:each) do
|
14
|
-
assign(:<%=
|
14
|
+
assign(:<%= singular_table_name %>, <%= singular_table_name %>)
|
15
15
|
end
|
16
16
|
|
17
17
|
it "renders the edit <%= ns_file_name %> form" do
|
18
18
|
render
|
19
19
|
|
20
|
-
assert_select "form[action=?][method=?]", <%= ns_file_name %>_path(<%=
|
20
|
+
assert_select "form[action=?][method=?]", <%= ns_file_name %>_path(<%= singular_table_name %>), "post" do
|
21
21
|
<% for attribute in output_attributes -%>
|
22
22
|
<%- name = attribute.respond_to?(:column_name) ? attribute.column_name : attribute.name %>
|
23
23
|
assert_select "<%= attribute.input_type -%>[name=?]", "<%= ns_file_name %>[<%= name %>]"
|
@@ -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 %>/new", <%= type_metatag(:view) %> do
|
5
5
|
before(:each) do
|
6
|
-
assign(:<%=
|
6
|
+
assign(:<%= singular_table_name %>, <%= class_name %>.new(<%= '))' 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 -%>
|
@@ -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
|
-
assign(:<%=
|
6
|
+
assign(:<%= singular_table_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 -%>
|
@@ -2,6 +2,10 @@
|
|
2
2
|
# suite and ammeter.
|
3
3
|
require 'rspec/rails/matchers'
|
4
4
|
|
5
|
+
if ::Rails::VERSION::MAJOR >= 7
|
6
|
+
require 'active_support/execution_context/test_helper'
|
7
|
+
end
|
8
|
+
|
5
9
|
module RSpec
|
6
10
|
module Rails
|
7
11
|
# @api public
|
@@ -12,7 +16,10 @@ module RSpec
|
|
12
16
|
include RSpec::Rails::MinitestLifecycleAdapter
|
13
17
|
include RSpec::Rails::MinitestAssertionAdapter
|
14
18
|
include RSpec::Rails::FixtureSupport
|
15
|
-
|
19
|
+
if ::Rails::VERSION::MAJOR >= 7
|
20
|
+
include RSpec::Rails::TaggedLoggingAdapter
|
21
|
+
include ActiveSupport::ExecutionContext::TestHelper
|
22
|
+
end
|
16
23
|
end
|
17
24
|
end
|
18
25
|
end
|
@@ -44,6 +44,52 @@ module RSpec
|
|
44
44
|
].join("_").tr(CHARS_TO_TRANSLATE.join, "_").byteslice(0...200).scrub("") + "_#{rand(1000)}"
|
45
45
|
end
|
46
46
|
|
47
|
+
if ::Rails::VERSION::STRING.to_f >= 7.1
|
48
|
+
# @private
|
49
|
+
# Allows failure screenshot to work whilst not exposing metadata
|
50
|
+
class SuppressRailsScreenshotMetadata
|
51
|
+
def initialize
|
52
|
+
@example_data = {}
|
53
|
+
end
|
54
|
+
|
55
|
+
def [](key)
|
56
|
+
if @example_data.key?(key)
|
57
|
+
@example_data[key]
|
58
|
+
else
|
59
|
+
raise_wrong_scope_error
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def []=(key, value)
|
64
|
+
if key == :failure_screenshot_path
|
65
|
+
@example_data[key] = value
|
66
|
+
else
|
67
|
+
raise_wrong_scope_error
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def method_missing(_name, *_args, &_block)
|
72
|
+
raise_wrong_scope_error
|
73
|
+
end
|
74
|
+
|
75
|
+
private
|
76
|
+
|
77
|
+
def raise_wrong_scope_error
|
78
|
+
raise RSpec::Core::ExampleGroup::WrongScopeError,
|
79
|
+
"`metadata` is not available from within an example " \
|
80
|
+
"(e.g. an `it` block) or from constructs that run in the " \
|
81
|
+
"scope of an example (e.g. `before`, `let`, etc). It is " \
|
82
|
+
"only available on an example group (e.g. a `describe` or "\
|
83
|
+
"`context` block)"
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# @private
|
88
|
+
def metadata
|
89
|
+
@metadata ||= SuppressRailsScreenshotMetadata.new
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
47
93
|
# Delegates to `Rails.application`.
|
48
94
|
def app
|
49
95
|
::Rails.application
|
@@ -89,7 +89,7 @@ module RSpec
|
|
89
89
|
#
|
90
90
|
# stub_template("widgets/_widget.html.erb" => "This content.")
|
91
91
|
def stub_template(hash)
|
92
|
-
|
92
|
+
controller.prepend_view_path(StubResolverCache.resolver_for(hash))
|
93
93
|
end
|
94
94
|
|
95
95
|
# Provides access to the params hash that will be available within the
|
@@ -21,7 +21,12 @@ module RSpec
|
|
21
21
|
if RSpec.configuration.use_active_record?
|
22
22
|
include Fixtures
|
23
23
|
|
24
|
-
|
24
|
+
# TestFixtures#fixture_path is deprecated and will be removed in Rails 7.2
|
25
|
+
if respond_to?(:fixture_paths=)
|
26
|
+
fixture_paths << RSpec.configuration.fixture_path
|
27
|
+
else
|
28
|
+
self.fixture_path = RSpec.configuration.fixture_path
|
29
|
+
end
|
25
30
|
self.use_transactional_tests = RSpec.configuration.use_transactional_fixtures
|
26
31
|
self.use_instantiated_fixtures = RSpec.configuration.use_instantiated_fixtures
|
27
32
|
|
@@ -32,28 +37,50 @@ module RSpec
|
|
32
37
|
module Fixtures
|
33
38
|
extend ActiveSupport::Concern
|
34
39
|
|
40
|
+
# rubocop:disable Metrics/BlockLength
|
35
41
|
class_methods do
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
+
if ::Rails.version.to_f >= 7.1
|
43
|
+
def fixtures(*args)
|
44
|
+
super.tap do
|
45
|
+
fixture_sets.each_key do |fixture_name|
|
46
|
+
proxy_method_warning_if_called_in_before_context_scope(fixture_name)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def proxy_method_warning_if_called_in_before_context_scope(fixture_name)
|
52
|
+
define_method(fixture_name) do |*args, **kwargs, &blk|
|
53
|
+
if RSpec.current_scope == :before_context_hook
|
54
|
+
RSpec.warn_with("Calling fixture method in before :context ")
|
55
|
+
else
|
56
|
+
access_fixture(fixture_name, *args, **kwargs, &blk)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
else
|
61
|
+
def fixtures(*args)
|
62
|
+
orig_methods = private_instance_methods
|
63
|
+
super.tap do
|
64
|
+
new_methods = private_instance_methods - orig_methods
|
65
|
+
new_methods.each do |method_name|
|
66
|
+
proxy_method_warning_if_called_in_before_context_scope(method_name)
|
67
|
+
end
|
42
68
|
end
|
43
69
|
end
|
44
|
-
end
|
45
70
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
71
|
+
def proxy_method_warning_if_called_in_before_context_scope(method_name)
|
72
|
+
orig_implementation = instance_method(method_name)
|
73
|
+
define_method(method_name) do |*args, &blk|
|
74
|
+
if RSpec.current_scope == :before_context_hook
|
75
|
+
RSpec.warn_with("Calling fixture method in before :context ")
|
76
|
+
else
|
77
|
+
orig_implementation.bind(self).call(*args, &blk)
|
78
|
+
end
|
53
79
|
end
|
54
80
|
end
|
55
81
|
end
|
56
82
|
end
|
83
|
+
# rubocop:enable Metrics/BlockLength
|
57
84
|
end
|
58
85
|
end
|
59
86
|
end
|
@@ -96,8 +96,11 @@ module RSpec
|
|
96
96
|
private
|
97
97
|
|
98
98
|
def stream
|
99
|
-
@stream ||=
|
99
|
+
@stream ||= case @target
|
100
|
+
when String
|
100
101
|
@target
|
102
|
+
when Symbol
|
103
|
+
@target.to_s
|
101
104
|
else
|
102
105
|
check_channel_presence
|
103
106
|
@channel.broadcasting_for(@target)
|
@@ -109,7 +112,7 @@ module RSpec
|
|
109
112
|
decoded = ActiveSupport::JSON.decode(msg)
|
110
113
|
decoded = decoded.with_indifferent_access if decoded.is_a?(Hash)
|
111
114
|
|
112
|
-
if @data.nil? || @data
|
115
|
+
if @data.nil? || values_match?(@data, decoded)
|
113
116
|
@block.call(decoded)
|
114
117
|
true
|
115
118
|
else
|
@@ -230,11 +230,11 @@ module RSpec
|
|
230
230
|
def matches?(proc)
|
231
231
|
raise ArgumentError, "have_enqueued_job and enqueue_job only support block expectations" unless Proc === proc
|
232
232
|
|
233
|
-
|
233
|
+
original_enqueued_jobs = Set.new(queue_adapter.enqueued_jobs)
|
234
234
|
proc.call
|
235
|
-
|
235
|
+
enqueued_jobs = Set.new(queue_adapter.enqueued_jobs)
|
236
236
|
|
237
|
-
check(
|
237
|
+
check(enqueued_jobs - original_enqueued_jobs)
|
238
238
|
end
|
239
239
|
|
240
240
|
def does_not_match?(proc)
|
data/lib/rspec/rails/version.rb
CHANGED
@@ -71,7 +71,15 @@ module RSpec
|
|
71
71
|
# templates with modified source
|
72
72
|
#
|
73
73
|
# @private
|
74
|
-
class ResolverDecorator
|
74
|
+
class ResolverDecorator < ::ActionView::Resolver
|
75
|
+
(::ActionView::Resolver.instance_methods - Object.instance_methods).each do |method|
|
76
|
+
undef_method method
|
77
|
+
end
|
78
|
+
|
79
|
+
(::ActionView::Resolver.methods - Object.methods).each do |method|
|
80
|
+
singleton_class.undef_method method
|
81
|
+
end
|
82
|
+
|
75
83
|
def initialize(resolver)
|
76
84
|
@resolver = resolver
|
77
85
|
end
|
@@ -119,11 +127,11 @@ module RSpec
|
|
119
127
|
# @private
|
120
128
|
module EmptyTemplates
|
121
129
|
def prepend_view_path(new_path)
|
122
|
-
|
130
|
+
super(_path_decorator(*new_path))
|
123
131
|
end
|
124
132
|
|
125
133
|
def append_view_path(new_path)
|
126
|
-
|
134
|
+
super(_path_decorator(*new_path))
|
127
135
|
end
|
128
136
|
|
129
137
|
private
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Chelimsky
|
8
8
|
- Andy Lindeman
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain:
|
12
12
|
- |
|
@@ -44,7 +44,7 @@ cert_chain:
|
|
44
44
|
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
|
45
45
|
F3MdtaDehhjC
|
46
46
|
-----END CERTIFICATE-----
|
47
|
-
date:
|
47
|
+
date: 2023-11-21 00:00:00.000000000 Z
|
48
48
|
dependencies:
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: actionpack
|
@@ -94,56 +94,56 @@ dependencies:
|
|
94
94
|
requirements:
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: '3.
|
97
|
+
version: '3.12'
|
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.
|
104
|
+
version: '3.12'
|
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.
|
111
|
+
version: '3.12'
|
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.
|
118
|
+
version: '3.12'
|
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.
|
125
|
+
version: '3.12'
|
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.
|
132
|
+
version: '3.12'
|
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.
|
139
|
+
version: '3.12'
|
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.
|
146
|
+
version: '3.12'
|
147
147
|
- !ruby/object:Gem::Dependency
|
148
148
|
name: ammeter
|
149
149
|
requirement: !ruby/object:Gem::Requirement
|
@@ -296,11 +296,11 @@ 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/v6.0.
|
299
|
+
changelog_uri: https://github.com/rspec/rspec-rails/blob/v6.0.4/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
|
303
|
-
post_install_message:
|
303
|
+
post_install_message:
|
304
304
|
rdoc_options:
|
305
305
|
- "--charset=UTF-8"
|
306
306
|
require_paths:
|
@@ -316,8 +316,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
316
316
|
- !ruby/object:Gem::Version
|
317
317
|
version: '0'
|
318
318
|
requirements: []
|
319
|
-
rubygems_version: 3.
|
320
|
-
signing_key:
|
319
|
+
rubygems_version: 3.4.10
|
320
|
+
signing_key:
|
321
321
|
specification_version: 4
|
322
322
|
summary: RSpec for Rails
|
323
323
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|