activeforce 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +1 -0
- data/Appraisals +4 -0
- data/Rakefile +1 -0
- data/activeforce.gemspec +1 -1
- data/gemfiles/5.2.gemfile +9 -0
- data/lib/activeforce/version.rb +1 -1
- data/test/salesforce/authentication_test.rb +6 -6
- data/test/salesforce/column_test.rb +37 -37
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dc7a5402fedf2239ab8c2ea3681ab20dd9fa4f2ebde12a63b47ba99925a94b29
|
4
|
+
data.tar.gz: '0382d48b239cb21ef6f683974816054dccc777c5aef6be40f7e02e8aef82e947'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2363a3005fb924f5785432f1ca6e8634d51fe354e12f99e62cc700237d52ff136297905b5d837788b441237dd2ed40942987a94b5a638de3ab6022d5b1b049cd
|
7
|
+
data.tar.gz: 1e2f2f9a304dd2b67c79ab9946df6f733a210445dd6d68d0822aae678452bf17ac98763f32d6386543940504fd398429bd63f2eab642bd43fffe17eb514f5cdd
|
data/.travis.yml
CHANGED
data/Appraisals
CHANGED
data/Rakefile
CHANGED
data/activeforce.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.required_ruby_version = ">= 2.0"
|
23
23
|
s.summary = "A Simple gem to interact with the Salesforce REST API"
|
24
24
|
|
25
|
-
s.add_dependency(%q<rails>, [">= 4.0", "<
|
25
|
+
s.add_dependency(%q<rails>, [">= 4.0", "< 6"])
|
26
26
|
s.add_dependency(%q<savon>, ["~> 2.11"])
|
27
27
|
s.add_dependency(%q<blockenspiel>, [">= 0"])
|
28
28
|
s.add_dependency(%q<rest-client>, [">= 0", '< 2.0'])
|
data/lib/activeforce/version.rb
CHANGED
@@ -10,7 +10,7 @@ class Salesforce::AuthenticationTest < ActiveSupport::TestCase
|
|
10
10
|
Salesforce::Config.instance.session_id "existingsessionid"
|
11
11
|
assert_equal "existingsessionid", Salesforce::Authentication.session_id
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def test_session_id__doesnotexist
|
15
15
|
Salesforce.configure do
|
16
16
|
username "username"
|
@@ -19,20 +19,20 @@ class Salesforce::AuthenticationTest < ActiveSupport::TestCase
|
|
19
19
|
Salesforce::Authentication.expects(:generate_new_session_id).returns("new_session_id")
|
20
20
|
assert_equal "new_session_id", Salesforce::Authentication.session_id
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
def test_session_id__credentials_missing
|
24
24
|
Salesforce::Authentication.expects(:generate_new_session_id).never
|
25
25
|
assert_raises Salesforce::InvalidCredentials do
|
26
26
|
Salesforce::Authentication.session_id
|
27
27
|
end
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
def test_logout
|
31
31
|
Salesforce::Config.instance.session_id = "session_id"
|
32
32
|
Salesforce::Authentication.logout
|
33
|
-
|
33
|
+
assert_nil Salesforce::Config.session_id
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
def test_generate_new_session_id__calls_connection_login
|
37
37
|
result = {
|
38
38
|
:session_id => "session_id",
|
@@ -83,5 +83,5 @@ class Salesforce::AuthenticationTest < ActiveSupport::TestCase
|
|
83
83
|
assert_equal "my.salesforce.com", Salesforce::Config.server_domain
|
84
84
|
assert_equal "user_id", Salesforce::Config.user_id
|
85
85
|
end
|
86
|
-
|
86
|
+
|
87
87
|
end
|
@@ -24,7 +24,7 @@ class Salesforce::ColumnTest < ActiveSupport::TestCase
|
|
24
24
|
assert_equal :string, col.type
|
25
25
|
assert_equal false, col.editable?
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
def test_initializer__editable
|
29
29
|
col = Salesforce::Column.new("name" => "Name__c", "type" => "string", "updateable" => true, "createable" => false)
|
30
30
|
assert_equal "name", col.name
|
@@ -39,35 +39,35 @@ class Salesforce::ColumnTest < ActiveSupport::TestCase
|
|
39
39
|
assert col.createable?
|
40
40
|
assert_equal false, col.updateable?
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
def test_to_soql_value
|
44
|
-
assert_equal "'string'", Salesforce::Column.to_soql_value('string')
|
45
|
-
assert_equal "TRUE", Salesforce::Column.to_soql_value(true)
|
46
|
-
assert_equal "FALSE", Salesforce::Column.to_soql_value(false)
|
47
|
-
assert_equal "NULL", Salesforce::Column.to_soql_value(nil)
|
48
|
-
assert_equal "2012-01-02", Salesforce::Column.to_soql_value(Date.parse('2012-01-02'))
|
49
|
-
assert_equal "2012-01-02T18:40:00-08:00", Salesforce::Column.to_soql_value(Time.zone.parse('2012-01-02 06:40PM'))
|
50
|
-
assert_equal "1", Salesforce::Column.to_soql_value(1)
|
51
|
-
assert_equal "1.0", Salesforce::Column.to_soql_value(1.0)
|
52
|
-
assert_equal "1.04", Salesforce::Column.to_soql_value(BigDecimal.new("1.04"))
|
53
|
-
assert_equal "'col'", Salesforce::Column.to_soql_value(:col)
|
44
|
+
assert_equal "'string'", Salesforce::Column.to_soql_value('string')
|
45
|
+
assert_equal "TRUE", Salesforce::Column.to_soql_value(true)
|
46
|
+
assert_equal "FALSE", Salesforce::Column.to_soql_value(false)
|
47
|
+
assert_equal "NULL", Salesforce::Column.to_soql_value(nil)
|
48
|
+
assert_equal "2012-01-02", Salesforce::Column.to_soql_value(Date.parse('2012-01-02'))
|
49
|
+
assert_equal "2012-01-02T18:40:00-08:00", Salesforce::Column.to_soql_value(Time.zone.parse('2012-01-02 06:40PM'))
|
50
|
+
assert_equal "1", Salesforce::Column.to_soql_value(1)
|
51
|
+
assert_equal "1.0", Salesforce::Column.to_soql_value(1.0)
|
52
|
+
assert_equal "1.04", Salesforce::Column.to_soql_value(BigDecimal.new("1.04"))
|
53
|
+
assert_equal "'col'", Salesforce::Column.to_soql_value(:col)
|
54
54
|
assert_equal "('string1','string2','string3')", Salesforce::Column.to_soql_value(['string1','string2','string3'])
|
55
55
|
assert_equal "('string1',1,2012-01-02)", Salesforce::Column.to_soql_value(['string1',1,Date.parse("2012-01-02")])
|
56
56
|
end
|
57
|
-
|
57
|
+
|
58
58
|
def test_to_csv_value
|
59
|
-
assert_equal "string", Salesforce::Column.to_csv_value('string')
|
60
|
-
assert_equal "TRUE", Salesforce::Column.to_csv_value(true)
|
61
|
-
assert_equal "FALSE", Salesforce::Column.to_csv_value(false)
|
62
|
-
assert_equal '#N/A', Salesforce::Column.to_csv_value(nil)
|
63
|
-
assert_equal "2012-01-02", Salesforce::Column.to_csv_value(Date.parse('2012-01-02'))
|
64
|
-
assert_equal "2012-01-02T18:40:00-08:00", Salesforce::Column.to_csv_value(Time.zone.parse('2012-01-02 06:40PM'))
|
65
|
-
assert_equal "1", Salesforce::Column.to_csv_value(1)
|
66
|
-
assert_equal "1.0", Salesforce::Column.to_csv_value(1.0)
|
67
|
-
assert_equal "1.04", Salesforce::Column.to_csv_value(BigDecimal.new("1.04"))
|
68
|
-
assert_equal "col", Salesforce::Column.to_csv_value(:col)
|
59
|
+
assert_equal "string", Salesforce::Column.to_csv_value('string')
|
60
|
+
assert_equal "TRUE", Salesforce::Column.to_csv_value(true)
|
61
|
+
assert_equal "FALSE", Salesforce::Column.to_csv_value(false)
|
62
|
+
assert_equal '#N/A', Salesforce::Column.to_csv_value(nil)
|
63
|
+
assert_equal "2012-01-02", Salesforce::Column.to_csv_value(Date.parse('2012-01-02'))
|
64
|
+
assert_equal "2012-01-02T18:40:00-08:00", Salesforce::Column.to_csv_value(Time.zone.parse('2012-01-02 06:40PM'))
|
65
|
+
assert_equal "1", Salesforce::Column.to_csv_value(1)
|
66
|
+
assert_equal "1.0", Salesforce::Column.to_csv_value(1.0)
|
67
|
+
assert_equal "1.04", Salesforce::Column.to_csv_value(BigDecimal.new("1.04"))
|
68
|
+
assert_equal "col", Salesforce::Column.to_csv_value(:col)
|
69
69
|
end
|
70
|
-
|
70
|
+
|
71
71
|
def test_typecast
|
72
72
|
assert_equal "123456789012345", Salesforce::Column.typecast(:id, "123456789012345")
|
73
73
|
assert_equal "123456789012345", Salesforce::Column.typecast(:id, "123456789012345123")
|
@@ -75,12 +75,12 @@ class Salesforce::ColumnTest < ActiveSupport::TestCase
|
|
75
75
|
assert_equal "123456789012345", Salesforce::Column.typecast(:reference, "123456789012345123")
|
76
76
|
assert_equal Date.parse("2011-08-31"), Salesforce::Column.typecast(:date, "2011-08-31")
|
77
77
|
assert_equal Date.parse("2011-08-31"), Salesforce::Column.typecast(:date, Date.parse("2011-08-31"))
|
78
|
-
|
79
|
-
|
78
|
+
assert_nil Salesforce::Column.typecast(:date, nil)
|
79
|
+
assert_nil Salesforce::Column.typecast(:date, 'nil')
|
80
80
|
|
81
81
|
assert_equal Time.zone.parse('2012-01-02 06:40PM'), Salesforce::Column.typecast(:datetime, "2012-01-02 18:40:00 -08:00")
|
82
82
|
assert_equal Time.zone.parse('2012-01-02 06:40PM'), Salesforce::Column.typecast(:datetime, Time.zone.parse('2012-01-02 06:40PM'))
|
83
|
-
|
83
|
+
assert_nil Salesforce::Column.typecast(:datetime, nil)
|
84
84
|
assert_equal Time.now.to_s, Salesforce::Column.typecast(:datetime, 'nil').to_s
|
85
85
|
|
86
86
|
assert_equal BigDecimal("2012"), Salesforce::Column.typecast(:double, "2012")
|
@@ -89,22 +89,22 @@ class Salesforce::ColumnTest < ActiveSupport::TestCase
|
|
89
89
|
assert_equal BigDecimal("1.2"), Salesforce::Column.typecast(:double, 1.2)
|
90
90
|
assert_equal 0, Salesforce::Column.typecast(:double, nil)
|
91
91
|
assert_equal 0, Salesforce::Column.typecast(:double, 'nil')
|
92
|
-
|
92
|
+
|
93
93
|
assert_equal true, Salesforce::Column.typecast(:boolean, true)
|
94
94
|
assert_equal false, Salesforce::Column.typecast(:boolean, false)
|
95
95
|
end
|
96
|
-
|
96
|
+
|
97
97
|
def test_typecast__date_max
|
98
|
-
|
98
|
+
assert_nil Salesforce::Column.typecast(:date, "9999-12-31")
|
99
99
|
assert_equal Date.parse("4000-12-30"), Salesforce::Column.typecast(:date, "4000-12-30")
|
100
|
-
|
101
|
-
|
100
|
+
assert_nil Salesforce::Column.typecast(:datetime, "9999-12-31")
|
101
|
+
assert_nil Salesforce::Column.typecast(:datetime, "4000-12-30")
|
102
102
|
end
|
103
103
|
|
104
104
|
def test_typecast__date_min
|
105
|
-
|
106
|
-
|
107
|
-
|
105
|
+
assert_nil Salesforce::Column.typecast(:date, "1699-13-31")
|
106
|
+
assert_nil Salesforce::Column.typecast(:datetime, "1700-01-01")
|
107
|
+
assert_nil Salesforce::Column.typecast(:datetime, "1699-12-31")
|
108
108
|
assert_equal Date.parse("01/01/1920").to_time, Salesforce::Column.typecast(:datetime, "1920-01-01")
|
109
109
|
end
|
110
110
|
|
@@ -115,12 +115,12 @@ class Salesforce::ColumnTest < ActiveSupport::TestCase
|
|
115
115
|
assert_equal "123456789012345", Salesforce::Column.typecast(:reference, "123456789012345")
|
116
116
|
assert_equal "123456789012345123", Salesforce::Column.typecast(:reference, "123456789012345123")
|
117
117
|
end
|
118
|
-
|
118
|
+
|
119
119
|
def test_equals
|
120
120
|
col1 = Salesforce::Column.new("name" => "Name", "type" => "string", "updateable" => true)
|
121
121
|
col2 = Salesforce::Column.new("name" => "Name", "type" => "string", "updateable" => false)
|
122
122
|
col3 = Salesforce::Column.new("name" => "Name__c", "type" => "string", "updateable" => true)
|
123
|
-
|
123
|
+
|
124
124
|
assert col1 == col2
|
125
125
|
assert col2 != col3
|
126
126
|
assert col1 != col3
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeforce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tushar Ranka
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
version: '4.0'
|
21
21
|
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '
|
23
|
+
version: '6'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
version: '4.0'
|
31
31
|
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '6'
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: savon
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -149,6 +149,7 @@ files:
|
|
149
149
|
- gemfiles/4.1.gemfile
|
150
150
|
- gemfiles/4.2.gemfile
|
151
151
|
- gemfiles/5.0.gemfile
|
152
|
+
- gemfiles/5.2.gemfile
|
152
153
|
- lib/activeforce.rb
|
153
154
|
- lib/activeforce/version.rb
|
154
155
|
- lib/ruby_187_range_extension.rb
|
@@ -204,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
204
205
|
version: '0'
|
205
206
|
requirements: []
|
206
207
|
rubyforge_project:
|
207
|
-
rubygems_version: 2.
|
208
|
+
rubygems_version: 2.7.7
|
208
209
|
signing_key:
|
209
210
|
specification_version: 4
|
210
211
|
summary: A Simple gem to interact with the Salesforce REST API
|