Sha256: 6711dac34e97f2cc86e71bd8fd5b9b20ebf2177d016bc82f51669330a162c6f5

Contents?: true

Size: 1023 Bytes

Versions: 3

Compression:

Stored size: 1023 Bytes

Contents

require 'spec_helper'
require 'livefyre'
require 'livefyre/factory/cursor_factory'

include Livefyre

describe Livefyre::CursorFactory do
  before(:each) do
    @network = Livefyre.get_network(NETWORK_NAME, NETWORK_KEY)
  end

  it 'should create a cursor with a personal stream resource' do
    topic = Topic.create(@network, 'ID', 'LABEL')
    cursor = CursorFactory.get_personal_stream_cursor(@network, USER_ID)
    expect(cursor.data.resource).to eq("#{@network.get_urn_for_user(USER_ID)}:personalStream")

    cursor = CursorFactory.get_personal_stream_cursor(@network, USER_ID, 10, Time.new)
    expect(cursor.data.limit).to eq(10)
  end

  it 'should create a cursor with a topic stream resource' do
    topic = Topic.create(@network, 'ID', 'LABEL')
    cursor = CursorFactory.get_topic_stream_cursor(@network, topic)
    expect(cursor.data.resource).to eq("#{topic.id}:topicStream")

    cursor = CursorFactory.get_topic_stream_cursor(@network, topic, 10, Time.new)
    expect(cursor.data.limit).to eq(10)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
livefyre-2.0.2 spec/livefyre/factory/cursor_factory_spec.rb
livefyre-2.0.1 spec/livefyre/factory/cursor_factory_spec.rb
livefyre-2.0.0 spec/livefyre/factory/cursor_factory_spec.rb