activeforce 1.10.0 → 1.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/activeforce/version.rb +1 -1
- data/lib/salesforce/authentication.rb +1 -1
- data/test/salesforce/authentication_test.rb +17 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f21729ed39bc14842ed2ca9dd4f76e30d0457a2
|
4
|
+
data.tar.gz: c1529d65db793a5db03f15ae73d153e3cbb3d0bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed40a4f4066b5aa97ba1509d56941814a0e2c4482d3bdefef281630c96ef1268cae58923e4c69bd836646d9d084704539544b008a9cbea4f52f17b5960445e05
|
7
|
+
data.tar.gz: a8703e1454c00b61618276035877637690a4830744cd98b270c7a2fb511ac23e87baa0eb71d6ded9cb40abb8701815c2b12837393568d1642958a98dabd6280a
|
data/lib/activeforce/version.rb
CHANGED
@@ -14,7 +14,7 @@ module Salesforce
|
|
14
14
|
Config.instance.session_id result[:session_id]
|
15
15
|
|
16
16
|
host = URI.parse(result[:server_url]).host
|
17
|
-
host_match = host.match(/(?<instance>[a-z0-9\-]+)\.(?<domain>(?:my\.)?salesforce\.com)/)
|
17
|
+
host_match = host.match(/(?<instance>[a-z0-9\-]+(?:\.[a-z]+\d+)?)\.(?<domain>(?:my\.)?salesforce\.com)/)
|
18
18
|
|
19
19
|
Config.instance.server_instance host_match[:instance]
|
20
20
|
Config.instance.server_domain host_match[:domain]
|
@@ -66,5 +66,22 @@ class Salesforce::AuthenticationTest < ActiveSupport::TestCase
|
|
66
66
|
assert_equal "my.salesforce.com", Salesforce::Config.server_domain
|
67
67
|
assert_equal "user_id", Salesforce::Config.user_id
|
68
68
|
end
|
69
|
+
|
70
|
+
def test_generate_new_session_id__calls_connection_login__my_domain__sandbox
|
71
|
+
result = {
|
72
|
+
:session_id => "session_id",
|
73
|
+
:server_url => "https://awesome-2000--some-sandbox.na2001.my.salesforce.com/services/Soap/c/22.0/00DQ00000001LRX",
|
74
|
+
:user_id => "user_id"
|
75
|
+
}
|
76
|
+
|
77
|
+
Salesforce.connection.expects(:login).returns(result)
|
78
|
+
|
79
|
+
assert_equal "session_id", Salesforce::Authentication.generate_new_session_id
|
80
|
+
assert_equal "https://awesome-2000--some-sandbox.na2001.my.salesforce.com/services/Soap/c/22.0/00DQ00000001LRX", Salesforce::Config.soap_endpoint_url
|
81
|
+
assert_equal "session_id", Salesforce::Config.session_id
|
82
|
+
assert_equal "awesome-2000--some-sandbox.na2001", Salesforce::Config.server_instance
|
83
|
+
assert_equal "my.salesforce.com", Salesforce::Config.server_domain
|
84
|
+
assert_equal "user_id", Salesforce::Config.user_id
|
85
|
+
end
|
69
86
|
|
70
87
|
end
|