Sha256: f40a2dddb32f10f8f476da5fca3fb52a4397b7e86ecd869d75a55f1100a7c028

Contents?: true

Size: 1.38 KB

Versions: 26

Compression:

Stored size: 1.38 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'])

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

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

    it 'fetches ubo declaration just by id' do
      legal_user = new_legal_user

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

      ubo_declaration_byId = MangoPay::UboDeclaration.fetch(nil, 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'])
        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)

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

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
mangopay-3.28.0 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.27.0 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.26.1 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.26.0 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.25.1 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.25.0 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.24.1 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.24.0 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.23.0 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.22.0 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.21.0 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.20.0 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.19.0 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.18.0 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.17.0 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.16.0 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.15.0 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.14.0 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.13.2 spec/mangopay/ubo_declaration_spec.rb
mangopay-3.12.0 spec/mangopay/ubo_declaration_spec.rb