Sha256: bddd95c27d95c8081c501ed999f3fa5dbab9144b3bc49a50189397a59573019d

Contents?: true

Size: 884 Bytes

Versions: 1

Compression:

Stored size: 884 Bytes

Contents

require 'spec_helper'

describe FbGraph::Connections::Messages, '#messages' do
  before do
    fake_json(:get, '12345/messages?access_token=access_token&no_cache=true', 'thread/messages/private')
  end

  it 'should use cached contents as default' do
    lambda do
      FbGraph::Thread.new(12345, :access_token => 'access_token').messages
    end.should_not request_to '12345/messages?access_token=access_token'
  end

  it 'should not use cached contents when options are specified' do
    lambda do
      FbGraph::Thread.new(12345).messages(:no_cache => true)
    end.should request_to '12345/messages?no_cache=true'
  end

  it 'should return threads as FbGraph::Message' do
    messages = FbGraph::Thread.new(12345, :access_token => 'access_token').messages(:no_cache => true)
    messages.each do |message|
      message.should be_instance_of(FbGraph::Message)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fb_graph-1.7.1 spec/fb_graph/connections/messages_spec.rb