Sha256: 289929c091999deb0a93f26a9d487de43ede6d7668f16d629fb565c28b195095

Contents?: true

Size: 1.05 KB

Versions: 4

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

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

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

  it 'should return former_participants as FbGraph::User' do
    mock_graph :get, '12345/former_participants', 'thread/former_participants/private', :params => {
      :access_token => 'access_token',
      :no_cache => 'true'
    } do
      former_participants = FbGraph::Thread.new(12345, :access_token => 'access_token').former_participants(:no_cache => true)
      former_participants.each do |former_participant|
        former_participant.should be_instance_of(FbGraph::User)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fb_graph-1.7.5 spec/fb_graph/connections/former_participants_spec.rb
fb_graph-1.7.4 spec/fb_graph/connections/former_participants_spec.rb
fb_graph-1.7.3 spec/fb_graph/connections/former_participants_spec.rb
fb_graph-1.7.2 spec/fb_graph/connections/former_participants_spec.rb