activeforce 2.1.0 → 2.1.1
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.
- 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: e5be44027a755de63755da1855edef9cccbebf72
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: e398c3a9ca3121b9d643e6f87f7af917c2daeb4e
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 787dd1eb72b321b27fc03eae2e0983b4c1f7b4d647ae1cf49830478d23e460b91095d3f5be4dae97a3862927b7a3d1ceae64c71c01b969b6b3b34c8db36fd2d3
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 3202443653176e1f775b1a0d7251a39ef590bc2e54e2c6e5c491eb55b9e9039c60acbd9e01db18f1e86110e97d8ae49a2392e1129940e77fc0617242193e76f5
         
     | 
    
        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
         
     |