Sha256: f700b7dcee46e0587e7e34d0ec0bd788508d177787acbd8d6c6634d69de51430

Contents?: true

Size: 1.01 KB

Versions: 3

Compression:

Stored size: 1.01 KB

Contents

require 'minitest/autorun'
require 'purecloud'

class PureCloudGemTest < Minitest::Test
    def setup
        @secret = ENV['purecloud_secret']
        @id = ENV['purecloud_client_id']

        PureCloud.authenticate_with_client_credentials @id, @secret, "mypurecloud.com"
        #PureCloud.configure.debugging = true
    end

    def test_auth_api
        auth_api = PureCloud::AuthorizationApi.new
        roles = auth_api.get_roles
        refute_nil roles
        #puts roles
    end

    def test_oauth_api
        oauth_api = PureCloud::OAuthApi.new
        opts = {
            :body=>PureCloud::OAuthClient.new({
                    :name => 'Gem Test Client',
                    :description => "generated from gem test script",
                    :authorizedGrantTypes => ["CLIENT-CREDENTIALS"],
                    :roleIds =>["02983623-600c-4779-a0ce-17f79e50e285"]
            })
        }

        client = oauth_api.create_clients opts
        refute_nil client

        oauth_api.delete_client client.id

    end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
purecloud-0.0.0 spec/test.rb
purecloud-0.18.0 spec/test.rb
purecloud-0.17.0 spec/test.rb