File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ def supports_block_expectations?
109
109
110
110
def check ( jobs )
111
111
@matching_jobs , @unmatching_jobs = jobs . partition do |job |
112
- if job_match? ( job ) && arguments_match? ( job ) && queue_match? ( job ) && at_match? ( job ) && priority_match ?( job )
112
+ if matches_constraints ?( job )
113
113
args = deserialize_arguments ( job )
114
114
@block . call ( *args )
115
115
true
@@ -123,10 +123,6 @@ def check(jobs)
123
123
return false
124
124
end
125
125
126
- check_countable
127
- end
128
-
129
- def check_countable
130
126
@matching_jobs_count = @matching_jobs . size
131
127
132
128
case @expectation_type
@@ -163,13 +159,23 @@ def base_job_message(job)
163
159
end
164
160
end
165
161
166
- def job_match? ( job )
162
+ def matches_constraints? ( job )
163
+ job_matches? ( job ) && arguments_match? ( job ) && queue_match? ( job ) && at_match? ( job ) && priority_match? ( job )
164
+ end
165
+
166
+ def job_matches? ( job )
167
167
@job ? @job == job [ :job ] : true
168
168
end
169
169
170
170
# Rails 6.1 serializes the priority with a string key
171
- def fetch_priority ( job )
172
- job [ :priority ] || job [ 'priority' ]
171
+ if ::Rails . version . to_f >= 7
172
+ def fetch_priority ( job )
173
+ job [ :priority ]
174
+ end
175
+ else
176
+ def fetch_priority ( job )
177
+ job [ 'priority' ]
178
+ end
173
179
end
174
180
175
181
def arguments_match? ( job )
You can’t perform that action at this time.
0 commit comments