Sha256: 5aab8383998496760f4f06c7881d272ce1cec81873bc32e541f0acd8f7f28a75

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(: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
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.1.6 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.1.5 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.1.4 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.1.3 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.1.2 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.1.1 spec/fb_graph/connections/photos_spec.rb
fb_graph-1.1.0 spec/fb_graph/connections/photos_spec.rb