test/test_client.rb in ringcentral_sdk-1.1.1 vs test/test_client.rb in ringcentral_sdk-1.2.0
- old
+ new
@@ -14,10 +14,23 @@
def test_main
assert_equal "bXlfYXBwX2tleTpteV9hcHBfc2VjcmV0", @rcsdk.send(:get_api_key)
end
+ def test_config
+ redirect_url = 'http://localhost:4567/oauth'
+ client = RingCentralSdk.new(
+ 'my_app_key',
+ 'my_app_secret',
+ RingCentralSdk::RC_SERVER_SANDBOX,
+ {
+ redirect_url: redirect_url
+ }
+ )
+ assert_equal redirect_url, client.app_config.redirect_url
+ end
+
def test_set_client
rcsdk = new_client()
assert_equal true, rcsdk.oauth2client.is_a?(OAuth2::Client)
rcsdk.set_oauth2_client()
@@ -181,11 +194,11 @@
stub_token_hash = data_auth_token_with_refresh
stub_token = OAuth2::AccessToken::from_hash(client.oauth2client, stub_token_hash)
client.oauth2client.password.stubs(:get_token).returns(stub_token)
- token = client.authorize('my_test_username', 'my_test_extension', 'my_test_password')
+ client.authorize('my_test_username', 'my_test_extension', 'my_test_password')
#@rcsdk.client.stubs(:post).returns(Faraday::Response.new)
Faraday::Connection.any_instance.stubs(:post).returns(Faraday::Response.new)
fax = RingCentralSdk::REST::Request::Fax.new(
@@ -261,10 +274,10 @@
stub_token_hash = data_auth_token_with_refresh
stub_token = OAuth2::AccessToken::from_hash(client.oauth2client, stub_token_hash)
client.oauth2client.password.stubs(:get_token).returns(stub_token)
- token = client.authorize('my_test_username', 'my_test_extension', 'my_test_password')
+ client.authorize('my_test_username', 'my_test_extension', 'my_test_password')
res = client.messages.sms.create(
from: '+16505551212',
to: '+14155551212',
text: 'test'