Sha256: e9f2db76e57cea30ed5a461d12ef3abe58c49f36a061407d2dd788396c064bbd

Contents?: true

Size: 966 Bytes

Versions: 20

Compression:

Stored size: 966 Bytes

Contents

require File.join(File.dirname(__FILE__), '../../spec_helper')

describe FbGraph::Connections::Photos, '#photos' do
  before(:all) do
    fake_json(:get, '12345/photos?access_token=access_token', 'albums/photos/matake_private')
  end

  it 'should return photos as FbGraph::Photo' 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

describe FbGraph::Connections::Photos, '#photo!' do
  before do
    fake_json(:post, '12345/photos', 'albums/photos/post_with_valid_access_token')
  end

  it 'should return generated photo' do
    photo = FbGraph::Album.new('12345', :access_token => 'valid').photo!(
      :image => 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

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
fb_graph-1.0.7 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.0.6 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.0.5 spec/fb_graph/connections/photos_spec.rb
palidanx-fb_graph-1.0.4 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.0.4 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.0.3 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.0.2 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.0.1 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.0.0 spec/fb_graph/connections/photos_spec.rb
fb_graph-0.8.0 spec/fb_graph/connections/photos_spec.rb
fb_graph-0.7.3 spec/fb_graph/connections/photos_spec.rb
fb_graph-0.7.2 spec/fb_graph/connections/photos_spec.rb
fb_graph-0.7.1 spec/fb_graph/connections/photos_spec.rb
fb_graph-0.7.0 spec/fb_graph/connections/photos_spec.rb
fb_graph-0.6.0 spec/fb_graph/connections/photos_spec.rb
fb_graph-0.5.0 spec/fb_graph/connections/photos_spec.rb
fb_graph-0.4.2 spec/fb_graph/connections/photos_spec.rb
fb_graph-0.4.1 spec/fb_graph/connections/photos_spec.rb
fb_graph-0.4.0 spec/fb_graph/connections/photos_spec.rb
fb_graph-0.3.0 spec/fb_graph/connections/photos_spec.rb