Sha256: d8ab41da4f0ceffe7837fde3273b9fc020d9f179c9aa8414a9aab9477a508e29

Contents?: true

Size: 1.23 KB

Versions: 5

Compression:

Stored size: 1.23 KB

Contents

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

describe FbGraph::Video, '#new' do

  it 'should setup all supported attributes' do
    attributes = {
      :id => '12345',
      :from => {
        :id => '23456',
        :name => 'nov matake'
      },
      :message => 'check this out!',
      :description => 'Smart.fm learning engine details',
      :length => 3600,
      :created_time => '2010-01-02T15:37:40+0000',
      :updated_time => '2010-01-02T15:37:41+0000'
    }
    video = FbGraph::Video.new(attributes.delete(:id), attributes)
    video.identifier.should   == '12345'
    video.from.should         == FbGraph::User.new('23456', :name => 'nov matake')
    video.message.should      == 'check this out!'
    video.description.should  == 'Smart.fm learning engine details'
    video.length.should       == 3600
    video.created_time.should == '2010-01-02T15:37:40+0000'
    video.updated_time.should == '2010-01-02T15:37:41+0000'
  end

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

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fb_graph-0.0.7 spec/fb_graph/video_spec.rb
fb_graph-0.0.6 spec/fb_graph/video_spec.rb
fb_graph-0.0.5 spec/fb_graph/video_spec.rb
fb_graph-0.0.4 spec/fb_graph/video_spec.rb
fb_graph-0.0.3 spec/fb_graph/video_spec.rb