Sha256: e38778ae93f6b1ec5d5035bd13e982fad39ecba7fd8bd0cc33e51489ded9c0b7

Contents?: true

Size: 874 Bytes

Versions: 10

Compression:

Stored size: 874 Bytes

Contents

require 'helper'

class UserContactsTest < Test::Unit::TestCase
  def setup
    setup_redtail
    @user = RubyRedtail::User.new('UserKey',@redtail_user_key)
  end
  
  should "be able to search contacts by name" do
    contacts = @user.contacts.search_by_name('Investor')
    assert_equal(Array, contacts.class)
    assert_equal(RubyRedtail::Contact, contacts.first.class)
  end  
  
  should "be able to search contacts by letter" do
    contacts = @user.contacts.search_by_letter('m')
    assert_equal(Array, contacts.class)
    assert_equal(RubyRedtail::Contact, contacts.first.class)
  end
  
  should "be able to search with that fancy method" do
    clients = @user.contacts.search([
      ['FirstName','=',"Mary"],
      ['LastName','=',"Investor"]
    ])
    assert_equal(Array, clients.class)
    assert_equal(RubyRedtail::Client, clients.first.class)
  end
  
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ruby-redtail-0.3.8 test/user_contacts_test.rb
ruby-redtail-0.3.7 test/user_contacts_test.rb
ruby-redtail-0.3.6 test/user_contacts_test.rb
ruby-redtail-0.3.5 test/user_contacts_test.rb
ruby-redtail-0.3.4 test/user_contacts_test.rb
ruby-redtail-0.3.3 test/user_contacts_test.rb
ruby-redtail-0.3.2 test/user_contacts_test.rb
ruby-redtail-0.3.1 test/user_contacts_test.rb
ruby-redtail-0.3.0 test/user_contacts_test.rb
ruby-redtail-0.2.0 test/user_contacts_test.rb