Sha256: e62c168c7187247764da276424d2d4d8e1f1f8c25221cf7c8fbdd58e5463992c

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 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',
      :message => 'check this out!',
      :updated_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.message.should       == 'check this out!'
    link.updated_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

1 entries across 1 versions & 1 rubygems

Version Path
fb_graph-0.0.8 spec/fb_graph/link_spec.rb