Sha256: dd1c1e0c22a0ddcd5466da8d8910fe7f4e5db480e0c9676d65ff5ec7b67bf9d6
Contents?: true
Size: 997 Bytes
Versions: 46
Compression:
Stored size: 997 Bytes
Contents
require 'test_helper' module Shipit class ChunkRollupJobTest < ActiveSupport::TestCase setup do @task = shipit_tasks(:shipit) @job = ChunkRollupJob.new end test "#perform combines all the chunks into a output and sets rolled_up to true" do expected_output = @task.chunk_output assert @task.output.blank? @job.perform(@task) @task.reload assert_equal 0, @task.chunks.count assert @task.output.present? assert_equal expected_output, @task.chunk_output assert @task.rolled_up end test "#peform ignores non-finished jobs" do logger = mock logger.expects(:error).once @job.stubs(logger: logger) @task.update_attribute(:status, :pending) @job.perform(@task) end test "#perform ignores tasks already rolled up" do logger = mock logger.expects(:error).once @job.stubs(logger: logger) @task.rolled_up = true @job.perform(@task) end end end
Version data entries
46 entries across 46 versions & 1 rubygems