Sha256: c0177b998d133ea680361631b3f91dcc629370111b87e57ff522f1f10d6ac67c

Contents?: true

Size: 1.57 KB

Versions: 56

Compression:

Stored size: 1.57 KB

Contents

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

describe FbGraph::Link, '.new' do

  it 'should setup all supported attributes' do
    attributes = {
      :id => '12345',
      :from => {
        :id => '23456',
        :name => 'nov matake'
      },
      :link => 'http://www.facebook.com/link/12345',
      :name => 'name',
      :caption => 'caption',
      :description => 'description',
      :icon => 'http://static.ak.fbcdn.net/rsrc.php/zB010/hash/9yvl71tw.gif',
      :picture => 'http://i.ytimg.com/vi/JA068qeB0oM/2.jpg',
      :message => 'check this out!',
      :created_time => '2010-01-02T15:37:41+0000'
    }
    link = FbGraph::Link.new(attributes.delete(:id), attributes)
    link.identifier.should   == '12345'
    link.from.should         == FbGraph::User.new('23456', :name => 'nov matake')
    link.link.should         == 'http://www.facebook.com/link/12345'
    link.name.should         == 'name'
    link.caption.should      == 'caption'
    link.description.should  == 'description'
    link.icon.should         == 'http://static.ak.fbcdn.net/rsrc.php/zB010/hash/9yvl71tw.gif'
    link.picture.should      == 'http://i.ytimg.com/vi/JA068qeB0oM/2.jpg'
    link.message.should      == 'check this out!'
    link.created_time.should == Time.parse('2010-01-02T15:37:41+0000')
  end

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

end

Version data entries

56 entries across 56 versions & 2 rubygems

Version Path
fb_graph-1.7.0 spec/fb_graph/link_spec.rb
fb_graph-1.7.0.alpha2 spec/fb_graph/link_spec.rb
fb_graph-1.6.9 spec/fb_graph/link_spec.rb
fb_graph-1.7.0.alpha spec/fb_graph/link_spec.rb
fb_graph-1.6.8 spec/fb_graph/link_spec.rb
fb_graph-1.6.7 spec/fb_graph/link_spec.rb
fb_graph-1.6.5 spec/fb_graph/link_spec.rb
fb_graph-1.6.4 spec/fb_graph/link_spec.rb
fb_graph-1.6.3 spec/fb_graph/link_spec.rb
fb_graph-1.6.2 spec/fb_graph/link_spec.rb
fb_graph-1.6.1 spec/fb_graph/link_spec.rb
fb_graph-1.6.0 spec/fb_graph/link_spec.rb
fb_graph-1.5.5 spec/fb_graph/link_spec.rb
fb_graph-1.5.4 spec/fb_graph/link_spec.rb
fb_graph-1.5.3 spec/fb_graph/link_spec.rb
fb_graph-1.5.2 spec/fb_graph/link_spec.rb
fb_graph-1.5.1 spec/fb_graph/link_spec.rb
fb_graph-1.5.0 spec/fb_graph/link_spec.rb
fb_graph-1.4.1 spec/fb_graph/link_spec.rb
fb_graph-1.4.0 spec/fb_graph/link_spec.rb