Sha256: 9a8dc16a69f34a89fc7b06b5b79bf2840d88172ca7a0c5e7fdddb447bf3453e9

Contents?: true

Size: 912 Bytes

Versions: 56

Compression:

Stored size: 912 Bytes

Contents

FactoryBot.define do
  factory :request, class: 'Inferno::Entities::Request' do
    transient do
      result { repo_create(:result, request_count: 0) }
      header_count { 2 }
    end

    result_id { result.id }

    verb { 'get' }
    url { 'http://www.example.com' }
    name { nil }
    status { 200 }
    direction { 'outgoing' }
    headers do
      [
        {
          type: 'request',
          name: 'Request-Header',
          value: 'REQUEST HEADER VALUE'
        },
        {
          type: 'response',
          name: 'Response-Header',
          value: 'RESPONSE HEADER VALUE'
        }
      ]
    end

    request_body { nil }

    sequence(:response_body) { |n| "RESPONSE_BODY #{n}" }

    test_session_id { result.test_session_id }

    initialize_with { new(**attributes) }

    to_create do |instance|
      Inferno::Repositories::Requests.new.create(instance.to_hash)
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
inferno_core-0.4.22 spec/factories/request.rb
inferno_core-0.4.21 spec/factories/request.rb
inferno_core-0.4.20 spec/factories/request.rb
inferno_core-0.4.19 spec/factories/request.rb
inferno_core-0.4.18 spec/factories/request.rb
inferno_core-0.4.17 spec/factories/request.rb
inferno_core-0.4.16 spec/factories/request.rb
inferno_core-0.4.15 spec/factories/request.rb
inferno_core-0.4.14 spec/factories/request.rb
inferno_core-0.4.13 spec/factories/request.rb
inferno_core-0.4.12 spec/factories/request.rb
inferno_core-0.4.11 spec/factories/request.rb
inferno_core-0.4.10 spec/factories/request.rb
inferno_core-0.4.9 spec/factories/request.rb
inferno_core-0.4.8 spec/factories/request.rb
inferno_core-0.4.7 spec/factories/request.rb
inferno_core-0.4.7.pre spec/factories/request.rb
inferno_core-0.4.6 spec/factories/request.rb
inferno_core-0.4.5 spec/factories/request.rb
inferno_core-0.4.4 spec/factories/request.rb