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 +2 -0
- data/lib/vtiger/commands.rb +4 -3
- data/test/test_vtiger.rb +15 -0
- metadata +3 -3
data/README.rdoc
CHANGED
data/lib/vtiger/commands.rb
CHANGED
@@ -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
|
-
|
116
|
-
|
117
|
-
|
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:
|
4
|
+
hash: 1
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 7
|
10
|
+
version: 0.4.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Scott Sproule
|