Sha256: 86a990becb5807a6f2cd418b92ab719b48878f88cb2b790328257a19e565555f

Contents?: true

Size: 1.42 KB

Versions: 15

Compression:

Stored size: 1.42 KB

Contents

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

describe FbGraph::Album, '.new' do

  it 'should setup all supported attributes' do
    attributes = {
      :id => '12345',
      :from => {
        :id => '23456',
        :name => 'nov matake'
      },
      :name => 'album 1',
      :description => 'an album for fb_graph test',
      :location => 'Tokyo, Japan',
      :link => 'http://www.facebook.com/album/12345',
      :count => 10,
      :created_time => '2009-12-29T15:24:50+0000',
      :updated_time => '2010-01-02T15:37:41+0000'
    }
    album = FbGraph::Album.new(attributes.delete(:id), attributes)
    album.identifier.should   == '12345'
    album.from.should         == FbGraph::User.new('23456', :name => 'nov matake')
    album.name.should         == 'album 1'
    album.description.should  == 'an album for fb_graph test'
    album.location.should     == 'Tokyo, Japan'
    album.link.should         == 'http://www.facebook.com/album/12345'
    album.count.should        == 10
    album.created_time.should == Time.parse('2009-12-29T15:24:50+0000')
    album.updated_time.should == Time.parse('2010-01-02T15:37:41+0000')
  end

  it 'should support page as from' do
    page_album = FbGraph::Album.new('12345', :from => {
      :id => '23456',
      :name => 'Smart.fm',
      :category => 'Web Site'
    })
    page_album.from.should == FbGraph::Page.new('23456', :name => 'Smart.fm', :category => 'Web Site')
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
fb_graph-0.7.1 spec/fb_graph/album_spec.rb
fb_graph-0.7.0 spec/fb_graph/album_spec.rb
fb_graph-0.6.0 spec/fb_graph/album_spec.rb
fb_graph-0.5.0 spec/fb_graph/album_spec.rb
fb_graph-0.4.2 spec/fb_graph/album_spec.rb
fb_graph-0.4.1 spec/fb_graph/album_spec.rb
fb_graph-0.4.0 spec/fb_graph/album_spec.rb
fb_graph-0.3.0 spec/fb_graph/album_spec.rb
fb_graph-0.2.2 spec/fb_graph/album_spec.rb
fb_graph-0.2.1 spec/fb_graph/album_spec.rb
fb_graph-0.2.0 spec/fb_graph/album_spec.rb
fb_graph-0.1.3 spec/fb_graph/album_spec.rb
fb_graph-0.1.2 spec/fb_graph/album_spec.rb
fb_graph-0.1.1 spec/fb_graph/album_spec.rb
fb_graph-0.1.0 spec/fb_graph/album_spec.rb