Sha256: 0db7f86b542fc37aad57208d2442add4e787d6b21bbe5dc1bd9b5104abe32b9b

Contents?: true

Size: 925 Bytes

Versions: 7

Compression:

Stored size: 925 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?'
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fb_graph-0.2.2 spec/fb_graph/connections/photos_spec.rb
fb_graph-0.2.1 spec/fb_graph/connections/photos_spec.rb
fb_graph-0.2.0 spec/fb_graph/connections/photos_spec.rb
fb_graph-0.1.3 spec/fb_graph/connections/photos_spec.rb
fb_graph-0.1.2 spec/fb_graph/connections/photos_spec.rb
fb_graph-0.1.1 spec/fb_graph/connections/photos_spec.rb
fb_graph-0.1.0 spec/fb_graph/connections/photos_spec.rb