Sha256: 0bf9effb1bd76bf8e15f9cd61fea0486580aea239deb10205b3d67c25ba526de

Contents?: true

Size: 736 Bytes

Versions: 9

Compression:

Stored size: 736 Bytes

Contents

require 'test_helper'
require 'resque/failure/redis'

context "Resque::Failure::Redis" do
  setup do
    @bad_string    = [39, 52, 127, 86, 93, 95, 39].map { |c| c.chr }.join
    exception      = StandardError.exception(@bad_string)
    worker         = Resque::Worker.new(:test)
    queue          = "queue"
    payload        = { "class" => Object, "args" => 3 }
    @redis_backend = Resque::Failure::Redis.new(exception, worker, queue, payload)
  end

  test 'cleans up bad strings before saving the failure, in order to prevent errors on the resque UI' do
    # test assumption: the bad string should not be able to round trip though JSON
    @redis_backend.save
    Resque::Failure::Redis.all # should not raise an error
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
resque-1.25.2 test/resque_failure_redis_test.rb
resque-1.26.pre.0 test/resque_failure_redis_test.rb
resque_signal_from_child-1.25.1 test/resque_failure_redis_test.rb
resque-1.25.1 test/resque_failure_redis_test.rb
resque-1.25.0 test/resque_failure_redis_test.rb
resque-1.25.0.pre test/resque_failure_redis_test.rb
resque-1.24.1 test/resque_failure_redis_test.rb
resque-1.24.0 test/resque_failure_redis_test.rb
resque-1.23.1 test/resque_failure_redis_test.rb