Sha256: af009876679c7b5f3a32e7a684f238f640cb6b4da7c0d47a8f23e465df3bb96f

Contents?: true

Size: 1.25 KB

Versions: 4

Compression:

Stored size: 1.25 KB

Contents

describe MangoPay::Ubo do
  include_context 'users'
  include_context 'ubo'

  describe 'FETCH' do
    it 'can fetch a Ubo' do
      legal_user = new_legal_user
      ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'], nil)
      ubo = new_ubo(legal_user, ubo_declaration)
      result = MangoPay::Ubo.fetch(legal_user['Id'], ubo_declaration['Id'], ubo['Id'])
      expect(result).not_to be_nil
      expect(result['Id']).equal? ubo['Id']
    end
  end

  describe 'CREATE' do
    it 'can create a new Ubo' do
      legal_user = new_legal_user
      ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'], nil)
      result = new_ubo(legal_user, ubo_declaration)
      expect(result).not_to be_nil
    end
  end

  describe 'UPDATE' do
    it 'can update a Ubo' do
      legal_user = new_legal_user
      ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'], nil)
      ubo = new_ubo(legal_user, ubo_declaration)
      ubo['FirstName'] = 'Santa'
      ubo['LastName'] = 'Clause'

      result = MangoPay::Ubo.update(legal_user['Id'], ubo_declaration['Id'], ubo['Id'], ubo)
      expect(result).not_to be_nil
      expect(result['FirstName']).equal? ubo['FirstName']
      expect(result['LastName']).equal? ubo['LastName']
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mangopay-3.6.0 spec/mangopay/ubo_spec.rb
mangopay-3.5.0 spec/mangopay/ubo_spec.rb
mangopay-3.4.0 spec/mangopay/ubo_spec.rb
mangopay-3.3.0 spec/mangopay/ubo_spec.rb