Sha256: 5d604b281e93dff75f8e68901b763ffb1c722c326936056d7f33b2ddc081ba4d

Contents?: true

Size: 779 Bytes

Versions: 4

Compression:

Stored size: 779 Bytes

Contents

 module CiviCrm::TestResponses
  def test_response(body, code = 200)
    body = CiviCrm::XML.encode(body) if !(body.kind_of? String)
    m = mock
    m.instance_variable_set('@data', { body: body, code: code})
    def m.body; @data[:body]; end
    def m.code; @data[:code]; end
    m
  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

4 entries across 4 versions & 1 rubygems

Version Path
civicrm-1.0.5 spec/support/civicrm_responses.rb
civicrm-1.0.4 spec/support/civicrm_responses.rb
civicrm-1.0.2 spec/support/civicrm_responses.rb
civicrm-1.0.1 spec/support/civicrm_responses.rb