Sha256: 1862ccace4d4edd14cb8fe0908f5af987d10c3eacf234290a2f4e8582f046f26

Contents?: true

Size: 1.23 KB

Versions: 11

Compression:

Stored size: 1.23 KB

Contents

require 'spec_helper'

describe IEX::Resources::Company do
  include_context 'client'

  context 'known symbol', vcr: { cassette_name: 'company/msft' } do
    subject do
      client.company('MSFT')
    end
    it 'retrieves company information' do
      expect(subject.symbol).to eq 'MSFT'
      expect(subject.ceo).to eq 'Satya Nadella'
      expect(subject.company_name).to eq 'Microsoft Corp.'
      expect(subject.description).to include 'Develops, manufactures and distributes software products'
      expect(subject.exchange).to eq 'NASDAQ'
      expect(subject.industry).to eq 'Packaged Software'
      expect(subject.issue_type).to eq 'cs'
      expect(subject.website).to eq 'http://www.microsoft.com'
      expect(subject.sector).to eq 'Technology Services'
      expect(subject.employees).to eq 131_000
      expect(subject.security_name).to eq 'Microsoft Corporation'
      expect(subject.tags).to eq ['Technology Services', 'Packaged Software']
    end
  end
  context 'invalid symbol', vcr: { cassette_name: 'company/invalid' } do
    subject do
      client.company('INVALID')
    end
    it 'fails with SymbolNotFoundError' do
      expect { subject }.to raise_error IEX::Errors::SymbolNotFoundError, 'Symbol INVALID Not Found'
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
iex-ruby-client-2.1.0 spec/iex/endpoints/company_spec.rb
iex-ruby-client-2.0.0 spec/iex/endpoints/company_spec.rb
iex-ruby-client-1.6.0 spec/iex/endpoints/company_spec.rb
iex-ruby-client-1.5.0 spec/iex/endpoints/company_spec.rb
iex-ruby-client-1.4.1 spec/iex/endpoints/company_spec.rb
iex-ruby-client-1.4.0 spec/iex/endpoints/company_spec.rb
iex-ruby-client-1.3.0 spec/iex/endpoints/company_spec.rb
iex-ruby-client-1.2.0 spec/iex/endpoints/company_spec.rb
iex-ruby-client-1.1.2 spec/iex/endpoints/company_spec.rb
iex-ruby-client-1.1.1 spec/iex/endpoints/company_spec.rb
iex-ruby-client-1.1.0 spec/iex/endpoints/company_spec.rb