Sha256: 256334c0a2ba3b8b9d6068c065f81b7ea17a587319e97a3b1e9b3cc7c524a0ed

Contents?: true

Size: 875 Bytes

Versions: 8

Compression:

Stored size: 875 Bytes

Contents

require 'hashie'
require 'faker'

FactoryGirl.define do

  factory :data_com_contacts_response, class: Hashie::Mash do
    unrecognized              { Hashie::Mash.new('contactId' => []) }
    pointsUsed                { Faker::Number.number(2).to_i        }
    totalHits                 { Faker::Number.number(2).to_i        }
    numberOfContactsPurchased { Faker::Number.number(2).to_i        }
    pointBalance              { Faker::Number.number(4).to_i        }
    contacts                  nil

    ignore do
      contacts_size 2
    end

    initialize_with { new(attributes) }

    after(:build) do |data_com_contacts_response, evaluator|
      unless data_com_contacts_response[:contacts]
        data_com_contacts_response[:contacts] = FactoryGirl.build_list(
          :data_com_contact,
          evaluator.contacts_size
        )
      end
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
data-com-api-0.2.1 spec/factories/data-com/contacts_response_factory.rb
data-com-api-0.2.0 spec/factories/data-com/contacts_response_factory.rb
data-com-api-0.1.5 spec/factories/data-com/contacts_response_factory.rb
data-com-api-0.1.4 spec/factories/data-com/contacts_response_factory.rb
data-com-api-0.1.3 spec/factories/data-com/contacts_response_factory.rb
data-com-api-0.1.2 spec/factories/data-com/contacts_response_factory.rb
data-com-api-0.1.1 spec/factories/data-com/contacts_response_factory.rb
data-com-api-0.1.0 spec/factories/data-com/contacts_response_factory.rb