Sha256: 8860881aada1a9a1e36a4c801ba77acf9e13a397656ea300cf4c9042dc798f7e

Contents?: true

Size: 1.33 KB

Versions: 30

Compression:

Stored size: 1.33 KB

Contents

require 'spec_helper'

describe Ayadn::Endpoints do
  before do
    Ayadn::Settings.stub(:user_token).and_return('XXX')
    Ayadn::Settings.stub(:options).and_return({
        counts: {
          unified: 33,
          default: 100
        },
        timeline: {
          directed: 1,
          deleted: 0,
          html: 0,
          annotations: 1
        }
      })
  end
  describe '#token_info' do
    it "returns the Token url" do
      expect(Ayadn::Endpoints.new.token_info).to eq 'https://api.app.net/token/?access_token=XXX'
    end
  end
  describe '#unified' do
    it "returns the Unified url" do
      expect(Ayadn::Endpoints.new.unified({})).to eq 'https://api.app.net/posts/stream/unified?access_token=XXX&count=33&include_html=0&include_directed=1&include_deleted=0&include_annotations=1'
    end
    it "returns the Unified url" do
      expect(Ayadn::Endpoints.new.unified({count: 66, html: 1})).to eq 'https://api.app.net/posts/stream/unified?access_token=XXX&count=66&include_html=1&include_directed=1&include_deleted=0&include_annotations=1'
    end
    it "returns the Unified url" do
      expect(Ayadn::Endpoints.new.unified({since_id: 336699})).to eq 'https://api.app.net/posts/stream/unified?access_token=XXX&count=100&include_html=0&include_directed=1&include_deleted=0&include_annotations=1&since_id=336699'
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
ayadn-1.7.1 spec/unit/endpoints_spec.rb
ayadn-1.7.0 spec/unit/endpoints_spec.rb
ayadn-1.6.0 spec/unit/endpoints_spec.rb
ayadn-1.5.1 spec/unit/endpoints_spec.rb
ayadn-1.5.0 spec/unit/endpoints_spec.rb
ayadn-1.4.6 spec/unit/endpoints_spec.rb
ayadn-1.4.5 spec/unit/endpoints_spec.rb
ayadn-1.4.4 spec/unit/endpoints_spec.rb
ayadn-1.4.3 spec/unit/endpoints_spec.rb
ayadn-1.4.2 spec/unit/endpoints_spec.rb
ayadn-1.4.1 spec/unit/endpoints_spec.rb
ayadn-1.4.0 spec/unit/endpoints_spec.rb
ayadn-1.3.2 spec/unit/endpoints_spec.rb
ayadn-1.3.1 spec/unit/endpoints_spec.rb
ayadn-1.3.0 spec/unit/endpoints_spec.rb
ayadn-1.2.10 spec/unit/endpoints_spec.rb
ayadn-1.2.9 spec/unit/endpoints_spec.rb
ayadn-1.2.8 spec/unit/endpoints_spec.rb
ayadn-1.2.7 spec/unit/endpoints_spec.rb
ayadn-1.2.6 spec/unit/endpoints_spec.rb