Sha256: d3069a4ba5742691c016d2f440d4d71cab13b5d7554369b56ad18fced1a64ec8

Contents?: true

Size: 911 Bytes

Versions: 41

Compression:

Stored size: 911 Bytes

Contents

require 'spec_helper'

describe FbGraph::Connections::Messages, '#messages' do
  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
    mock_graph :get, '12345/messages', 'thread/messages/private', :params => {:no_cache => 'true'}, :access_token => 'access_token' 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
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
fb_graph-2.2.2 spec/fb_graph/connections/messages_spec.rb
fb_graph-2.2.1 spec/fb_graph/connections/messages_spec.rb
fb_graph-2.2.0 spec/fb_graph/connections/messages_spec.rb
fb_graph-2.2.0.beta spec/fb_graph/connections/messages_spec.rb
fb_graph-2.2.0.alpha2 spec/fb_graph/connections/messages_spec.rb
fb_graph-2.2.0.alpha spec/fb_graph/connections/messages_spec.rb
fb_graph-2.1.13 spec/fb_graph/connections/messages_spec.rb
fb_graph-2.1.12 spec/fb_graph/connections/messages_spec.rb
fb_graph-2.1.11 spec/fb_graph/connections/messages_spec.rb
fb_graph-2.1.10 spec/fb_graph/connections/messages_spec.rb
fb_graph-2.1.9 spec/fb_graph/connections/messages_spec.rb
fb_graph-2.1.8 spec/fb_graph/connections/messages_spec.rb
fb_graph-2.1.7 spec/fb_graph/connections/messages_spec.rb
fb_graph-2.1.6 spec/fb_graph/connections/messages_spec.rb
fb_graph-2.1.5 spec/fb_graph/connections/messages_spec.rb
fb_graph-2.1.4 spec/fb_graph/connections/messages_spec.rb
fb_graph-2.1.3 spec/fb_graph/connections/messages_spec.rb
fb_graph-2.1.2 spec/fb_graph/connections/messages_spec.rb
fb_graph-2.1.1 spec/fb_graph/connections/messages_spec.rb
fb_graph-2.1.0 spec/fb_graph/connections/messages_spec.rb