Sha256: 1a9bd781584e99895d47bc7a3851a3119f8e69a44a63ecdf76578dfe75735d39

Contents?: true

Size: 1.01 KB

Versions: 7

Compression:

Stored size: 1.01 KB

Contents

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

describe FbGraph::Connections::Photos, '#photos' do
  context 'when included by FbGraph::Album' do
    before 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
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

7 entries across 7 versions & 1 rubygems

Version Path
fb_graph-1.2.5 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.2.4 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.2.3 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.2.2 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.2.1 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.2.0 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.1.7 spec/fb_graph/connections/photos_spec.rb