5757 expect ( attributes [ :job_id ] [ :value ] ) . to be_a ( String )
5858 expect ( attributes [ :queue_name ] [ :value ] ) . to eq ( "default" )
5959 expect ( attributes [ :executions ] [ :value ] ) . to eq ( 1 )
60- expect ( attributes [ :priority ] [ :value ] ) . to be_a ( Integer ) . or be_nil
60+ expect ( attributes [ :priority ] [ :value ] ) . to be_a ( Integer ) . or ( eq ( "null" ) ) . or be_nil
6161 end
6262
6363 it "includes adapter information when available" do
@@ -122,8 +122,9 @@ def perform(*args, **kwargs)
122122 expect ( log_event ) . not_to be_nil
123123
124124 attributes = log_event [ :attributes ]
125- expect ( attributes [ :arguments ] [ :value ] ) . to be_a ( Array )
126- expect ( attributes [ :arguments ] [ :value ] ) . to include ( "safe_arg" )
125+ arguments = JSON . parse ( attributes [ :arguments ] [ :value ] )
126+ expect ( arguments ) . to be_a ( Array )
127+ expect ( arguments ) . to include ( "safe_arg" )
127128 end
128129
129130 it "filters sensitive arguments" do
@@ -147,11 +148,11 @@ def perform(password:, token:, safe_data:)
147148 expect ( log_event ) . not_to be_nil
148149
149150 attributes = log_event [ :attributes ]
150- arguments = attributes [ :arguments ] [ :value ]
151+ arguments = JSON . parse ( attributes [ :arguments ] [ :value ] )
151152
152- expect ( arguments . first ) . to include ( safe_data : "public" )
153- expect ( arguments . first ) . to include ( password : "[FILTERED]" )
154- expect ( arguments . first ) . to include ( token : "[FILTERED]" )
153+ expect ( arguments . first ) . to include ( " safe_data" => "public" )
154+ expect ( arguments . first ) . to include ( " password" => "[FILTERED]" )
155+ expect ( arguments . first ) . to include ( " token" => "[FILTERED]" )
155156
156157 Rails . application . config . filter_parameters = original_filter_params
157158 end
@@ -175,7 +176,7 @@ def perform(short_string, long_string)
175176 expect ( log_event ) . not_to be_nil
176177
177178 attributes = log_event [ :attributes ]
178- arguments = attributes [ :arguments ] [ :value ]
179+ arguments = JSON . parse ( attributes [ :arguments ] [ :value ] )
179180
180181 expect ( arguments ) . to include ( "short" )
181182 expect ( arguments ) . to include ( "[FILTERED: 150 chars]" )
@@ -204,11 +205,11 @@ def perform(string_arg, hash_arg, number_arg, array_arg)
204205 expect ( log_event ) . not_to be_nil
205206
206207 attributes = log_event [ :attributes ]
207- arguments = attributes [ :arguments ] [ :value ]
208+ arguments = JSON . parse ( attributes [ :arguments ] [ :value ] )
208209
209210 expect ( arguments [ 0 ] ) . to eq ( "string_value" )
210- expect ( arguments [ 1 ] ) . to include ( safe_key : "value" )
211- expect ( arguments [ 1 ] ) . to include ( password : "[FILTERED]" )
211+ expect ( arguments [ 1 ] ) . to include ( " safe_key" => "value" )
212+ expect ( arguments [ 1 ] ) . to include ( " password" => "[FILTERED]" )
212213 expect ( arguments [ 2 ] ) . to eq ( 42 )
213214 expect ( arguments [ 3 ] ) . to eq ( [ 1 , 2 , 3 ] )
214215 end
0 commit comments