Sha256: 9eb3fb87f842c4aff60f9ab41703a6ebb5fbb392e882bf89faf757d2d8430c9a

Contents?: true

Size: 929 Bytes

Versions: 21

Compression:

Stored size: 929 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

    tags { [] }

    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

21 entries across 21 versions & 1 rubygems

Version Path
inferno_core-0.5.0 spec/factories/request.rb
inferno_core-0.4.44 spec/factories/request.rb
inferno_core-0.4.43 spec/factories/request.rb
inferno_core-0.4.42 spec/factories/request.rb
inferno_core-0.4.41 spec/factories/request.rb
inferno_core-0.4.40 spec/factories/request.rb
inferno_core-0.4.39 spec/factories/request.rb
inferno_core-0.4.38 spec/factories/request.rb
inferno_core-0.4.35 spec/factories/request.rb
inferno_core-0.4.34 spec/factories/request.rb
inferno_core-0.4.33 spec/factories/request.rb
inferno_core-0.4.32 spec/factories/request.rb
inferno_core-0.4.31 spec/factories/request.rb
inferno_core-0.4.30 spec/factories/request.rb
inferno_core-0.4.29 spec/factories/request.rb
inferno_core-0.4.28 spec/factories/request.rb
inferno_core-0.4.27 spec/factories/request.rb
inferno_core-0.4.26 spec/factories/request.rb
inferno_core-0.4.25 spec/factories/request.rb
inferno_core-0.4.24 spec/factories/request.rb