Sha256: 32484f6de32f83ff91e2429f500510204e1923a0668ddc15d9d146656273de2c
Contents?: true
Size: 1.45 KB
Versions: 13
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!( :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 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!( :image => 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
13 entries across 13 versions & 1 rubygems