vtiger 0.4.6 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc CHANGED
@@ -29,6 +29,8 @@ many commands are supported
29
29
 
30
30
  are all running
31
31
 
32
+ Now has find_by_email_id
33
+
32
34
  == SYNOPSIS:
33
35
 
34
36
  Vtiger::Api.api_settings = {
@@ -112,9 +112,10 @@ module Vtiger
112
112
  end
113
113
  def query_element_by_email(email,element)
114
114
  puts "in query element by email"
115
- action_string=ERB::Util.url_encode("select id from #{element} where email like '#{email}';")
116
- action_string=ERB::Util.url_encode("select id from #{element} where email1 like '#{email}';") if element=='Accounts'
117
- # puts "action string:" +action_string
115
+ field='email'
116
+ field='email1' if element=='Accounts'
117
+ action_string=ERB::Util.url_encode("select id from #{element} where #{field} like '#{email}';")
118
+ # puts "action string:" +action_string
118
119
  res = http_ask_get(self.endpoint_url+"operation=query&sessionName=#{self.session_name}&query="+action_string)
119
120
  values=res["result"][0] if res["success"]==true #comes back as array
120
121
  success = false
data/test/test_vtiger.rb CHANGED
@@ -176,6 +176,21 @@ class TestVtiger < Test::Unit::TestCase
176
176
  assert tt,"trouble ticket findersshould succeed"
177
177
  puts "tickelist is #{ticketlist}"
178
178
  end
179
+ def test_find_account_by_email
180
+ puts "in find account by email"
181
+ cmd = Vtiger::Commands.new()
182
+ challenge=cmd.challenge(@options)
183
+ login=cmd.login(@options)
184
+ hv={}
185
+ # hv[:firstname]='test'
186
+ success,account_id=cmd.query_element_by_email("scott.sproule@gmail.com","Accounts")
187
+ assert challenge,"challenge is false "
188
+ assert success,"could not find account id with email scott.sproule@gmail.com "
189
+ assert login,"login should succeed"
190
+ puts "ACCOUNT ID IS #{account_id}"
191
+ assert account_id=='3x269',"account id should be #{account_id}"
192
+ # puts "tickelist is #{ticketlist}"
193
+ end
179
194
  def test_describe_object
180
195
  cmd = Vtiger::Commands.new()
181
196
  challenge=cmd.challenge(@options)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vtiger
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 6
10
- version: 0.4.6
9
+ - 7
10
+ version: 0.4.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Scott Sproule