Sha256: 5249437730b52510c9acaed127542209621a4d08aa2a4db7bcd267e3a0f81c47

Contents?: true

Size: 1.45 KB

Versions: 91

Compression:

Stored size: 1.45 KB

Contents

require 'spec_helper'

describe FbGraph::Connections::Photos, '#photos' do
  context 'when included by FbGraph::Album' do
    it 'should return photos as FbGraph::Photo' do
      mock_graph :get, '12345/photos', 'albums/photos/matake_private', :access_token => 'access_token' do
        photos = FbGraph::Album.new('12345', :access_token => 'access_token').photos
        photos.each do |photo|
          photo.should be_instance_of(FbGraph::Photo)
        end
      end
    end
  end
end

describe FbGraph::Connections::Photos, '#photo!' do
  it 'should return generated photo' do
    mock_graph :post, '12345/photos', 'albums/photos/post_with_valid_access_token' do
      photo = FbGraph::Album.new('12345', :access_token => 'valid').photo!(
        :source => Tempfile.new('image_file'),
        :message => 'Hello, where is photo?'
      )
      photo.identifier.should == 401111132276
      photo.name.should == 'Hello, where is photo?'
      photo.access_token.should == 'valid'
    end
  end

  it 'should support Tag' do
    mock_graph :post, '12345/photos', 'albums/photos/post_with_valid_access_token' do
      photo = FbGraph::Album.new('12345', :access_token => 'valid').photo!(
        :source => Tempfile.new('image_file'),
        :message => 'Hello, where is photo?',
        :tags => [FbGraph::Tag.new(:id => 12345, :name => 'me', :x => 0, :y => 10)]
      )
      photo.tags.should == [FbGraph::Tag.new(:id => 12345, :name => 'me', :x => 0, :y => 10)]
    end
  end
end

Version data entries

91 entries across 91 versions & 1 rubygems

Version Path
fb_graph-2.4.16 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.4.15 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.4.14 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.4.13 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.4.12 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.4.11 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.4.10 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.4.9 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.4.8 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.4.7 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.4.6 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.4.4 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.4.3 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.4.2 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.4.1 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.4.0 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.3.2 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.3.1 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.3.0 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.2.6 spec/fb_graph/connections/photos_spec.rb