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.7.17 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.7.16 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.7.15 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.7.14 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.7.13 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.7.12 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.7.11 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.7.10 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.7.9 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.7.8 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.7.7 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.7.6 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.7.5 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.7.4 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.7.3 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.7.2 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.7.1 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.7.0 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.6.7 spec/fb_graph/connections/photos_spec.rb
fb_graph-2.6.6 spec/fb_graph/connections/photos_spec.rb