Sha256: 89cfa061c1303bc013ae410c29d7344d4629e06d65c8e01fc952b07bef4de437

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

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

  describe 'FETCH' do
    it 'can fetch a UBO declaration' do
      legal_user = new_legal_user

      ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'], nil)

      ubo_declaration_byId = MangoPay::UboDeclaration.fetch(legal_user['Id'], ubo_declaration['Id'], nil)

      expect(ubo_declaration).not_to be_nil
      expect(ubo_declaration_byId).not_to be_nil
    end

    describe 'UPDATE' do
      it 'can update a UBO declaration' do
        legal_user = new_legal_user
        ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'], nil)
        ubo_declaration['Status'] = 'VALIDATION_ASKED'

        ubo = new_ubo(legal_user, ubo_declaration)

        ubo_declaration['Ubos'] = [ubo]
        ubo_declaration = MangoPay::UboDeclaration.update(legal_user['Id'], ubo_declaration['Id'], ubo_declaration, nil)

        expect(ubo_declaration).not_to be_nil
        expect(ubo_declaration['Status']).to eq 'VALIDATION_ASKED'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mangopay-3.4.0 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.3.0 spec/mangopay/ubo_declaration_spec.rb