Sha256: 37f4495bff11774d4def991df862c8398fa342414fcc6c0abcf2ddf3cf25df9d

Contents?: true

Size: 677 Bytes

Versions: 11

Compression:

Stored size: 677 Bytes

Contents

 module CiviCrm::TestResponses
  def test_response(body, code = 200)
    body = JSON.dump(is_error: 0, values: [body]) if !(body.kind_of? String)
    double(body: body, code: code)
  end

  def test_contact(params = {})
    {
      :id => '1',
      :contact_id => '1',
      :contact_type => 'Organization',
      :sort_name => 'Inner City Arts',
      :display_name => 'Inner City Arts',
      :name => 'Bruce Lee',
      :description => 'Foo bar',
      :created => '1345537759',
      :livemode => false
    }.merge(params)
  end

  def test_contact_array
    {
      :count => 3, :is_error => 0,
      :values => [test_contact, test_contact, test_contact]
    }
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
civicrm-1.3.7 spec/support/civicrm_responses.rb
civicrm-1.3.6 spec/support/civicrm_responses.rb
civicrm-1.3.5 spec/support/civicrm_responses.rb
civicrm-1.3.4 spec/support/civicrm_responses.rb
civicrm-1.3.3 spec/support/civicrm_responses.rb
civicrm-1.3.2 spec/support/civicrm_responses.rb
civicrm-1.3.1 spec/support/civicrm_responses.rb
civicrm-1.2.5 spec/support/civicrm_responses.rb
civicrm-1.2.2 spec/support/civicrm_responses.rb
civicrm-1.2.1 spec/support/civicrm_responses.rb
civicrm-1.2.0 spec/support/civicrm_responses.rb