Sha256: f95fdb1d05b6b64f2732a8aa3f845ea1b91e3094344fde4b1662a0f74502a236

Contents?: true

Size: 1.66 KB

Versions: 15

Compression:

Stored size: 1.66 KB

Contents

=begin
#Dropbox Sign API

#Dropbox Sign v3 API

The version of the OpenAPI document: 3.0.0
Contact: apisupport@hellosign.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.3.0

=end

require 'spec_helper'
require 'json_spec'
require_relative '../test_utils'

describe Dropbox::Sign::OAuthApi do
  context 'OAuthApiTest' do
    api = Dropbox::Sign::OAuthApi.new

    it 'testTokenGenerate' do
      request_class = 'OAuthTokenGenerateRequest'
      request_data = get_fixture_data(request_class)[:default]

      response_class = 'OAuthTokenResponse'
      response_data = get_fixture_data(response_class)[:default]

      set_expected_response(200, JSON.dump(response_data))
      expected = Dropbox::Sign::OAuthTokenResponse.init(response_data)
      obj = Dropbox::Sign::OAuthTokenGenerateRequest.init(request_data)

      result = api.oauth_token_generate(obj)

      expect(result.class.to_s).to eq("Dropbox::Sign::#{response_class}")
      expect(result.to_json).to be_json_eql(JSON.dump(expected))
    end

    it 'testTokenRefresh' do
      request_class = 'OAuthTokenRefreshRequest'
      request_data = get_fixture_data(request_class)[:default]

      response_class = 'OAuthTokenResponse'
      response_data = get_fixture_data(response_class)[:default]

      set_expected_response(200, JSON.dump(response_data))
      expected = Dropbox::Sign::OAuthTokenResponse.init(response_data)
      obj = Dropbox::Sign::OAuthTokenRefreshRequest.init(request_data)

      result = api.oauth_token_refresh(obj)

      expect(result.class.to_s).to eq("Dropbox::Sign::#{response_class}")
      expect(result.to_json).to be_json_eql(JSON.dump(expected))
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
dropbox-sign-1.8.0 spec/api/oauth_api_spec.rb
dropbox-sign-1.7.0 spec/api/oauth_api_spec.rb
dropbox-sign-1.6.1 spec/api/oauth_api_spec.rb
dropbox-sign-1.6.0 spec/api/oauth_api_spec.rb
dropbox-sign-1.5.0 spec/api/oauth_api_spec.rb
dropbox-sign-1.4.1 spec/api/oauth_api_spec.rb
dropbox-sign-1.4.0 spec/api/oauth_api_spec.rb
dropbox-sign-1.3.0 spec/api/oauth_api_spec.rb
dropbox-sign-1.2.0 spec/api/oauth_api_spec.rb
dropbox-sign-1.1.2 spec/api/oauth_api_spec.rb
dropbox-sign-1.1.1 spec/api/oauth_api_spec.rb
dropbox-sign-1.1.0 spec/api/oauth_api_spec.rb
dropbox-sign-1.0.1 spec/api/oauth_api_spec.rb
dropbox-sign-1.0.0 spec/api/oauth_api_spec.rb
dropbox-sign-1.0.0.pre.beta2301 spec/api/oauth_api_spec.rb