Sha256: 882782f756a755694dc2f76aba565ca859d7f7d85326ca470b75afff9291f909

Contents?: true

Size: 674 Bytes

Versions: 1

Compression:

Stored size: 674 Bytes

Contents

module AsyncRequest
  FactoryGirl.define do
    factory :async_request_job, class: 'AsyncRequest::Job' do
      worker { Faker::Lorem.word }
      status_code 200
      response { { a: Faker::Lorem.word, b: Faker::Lorem.word, c: Faker::Lorem.word }.to_json }
      uid { Faker::Lorem.word }
      params [Faker::Lorem.word, { a: 'a' }]
    end

    trait :waiting do
      status Job.statuses[:waiting]
    end

    trait :processing do
      status Job.statuses[:processing]
    end

    trait :processed do
      status Job.statuses[:processed]
    end

    trait :failed do
      status Job.statuses[:failed]
      status_code 500
      response { {} }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
async_request-1.0.0 spec/factories/async_request_job.rb