Sha256: b5cfc34377b3be607f5a07658c5658e7c29da2077c1dbd6a4ddda5bf1424a667

Contents?: true

Size: 1.4 KB

Versions: 9

Compression:

Stored size: 1.4 KB

Contents

require 'spec_helper'

describe GnipApi::Endpoints do
  before do
    configure_gem
    @source = 'somewhere'
    @label = 'stream'
  end
  
  describe '.powertrack_rules' do
    it 'returns URI object' do
      expect(GnipApi::Endpoints.powertrack_rules(@source, @label).kind_of?(URI)).to eq(true)
    end

    describe 'URI returned' do
      before do
        @uri = GnipApi::Endpoints.powertrack_rules(@source, @label)
      end
      it 'contains source in path' do
        expect(@uri.path.include?(@source)).to eq(true)
      end

      it 'contains label in path' do
        expect(@uri.path.include?(@label)).to eq(true)
      end

      it 'includes account in path' do
        expect(@uri.path.include?(GnipApi.configuration.account)).to eq(true)
      end
    end
  end

  describe '.powertrack_stream' do
    it 'returns URI object' do
      expect(GnipApi::Endpoints.powertrack_stream(@source, @label).kind_of?(URI)).to eq(true)
    end

    describe 'URI returned' do
      before do
        @uri = GnipApi::Endpoints.powertrack_stream(@source, @label)
      end
      it 'contains source in path' do
        expect(@uri.path.include?(@source)).to eq(true)
      end

      it 'contains label in path' do
        expect(@uri.path.include?(@label)).to eq(true)
      end

      it 'includes account in path' do
        expect(@uri.path.include?(GnipApi.configuration.account)).to eq(true)
      end
    end
  end
  
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gnip_api-0.0.9 spec/gnip_api/endpoints_spec.rb
gnip_api-0.0.8 spec/gnip_api/endpoints_spec.rb
gnip_api-0.0.7 spec/gnip_api/endpoints_spec.rb
gnip_api-0.0.6 spec/gnip_api/endpoints_spec.rb
gnip_api-0.0.5 spec/gnip_api/endpoints_spec.rb
gnip_api-0.0.4 spec/gnip_api/endpoints_spec.rb
gnip_api-0.0.3 spec/gnip_api/endpoints_spec.rb
gnip_api-0.0.2 spec/gnip_api/endpoints_spec.rb
gnip_api-0.0.1 spec/gnip_api/endpoints_spec.rb