Sha256: f0cfd75a625af726a270e40e85bfc88537559b21df669e7a313586a67dfb64b1

Contents?: true

Size: 985 Bytes

Versions: 95

Compression:

Stored size: 985 Bytes

Contents

require 'spec_helper'

describe FbGraph::Video, '.new' do

  it 'should setup all supported attributes' do
    mock_graph :get, 'video', 'videos/private', :access_token => 'access_token' do
      video = FbGraph::Video.new('video', :access_token => 'access_token').fetch
      video.from.should be_a FbGraph::User
      video.tags.should be_a Array
      video.tags.each do |tag|
        tag.should be_a FbGraph::Tag
      end
      [:name, :description, :embed_html, :icon, :source].each do |attribute|
        video.send(attribute).should be_a String
      end
      [:created_time, :updated_time].each do |attribute|
        video.send(attribute).should be_a Time
      end
    end
  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

95 entries across 95 versions & 1 rubygems

Version Path
fb_graph-2.7.17 spec/fb_graph/video_spec.rb
fb_graph-2.7.16 spec/fb_graph/video_spec.rb
fb_graph-2.7.15 spec/fb_graph/video_spec.rb
fb_graph-2.7.14 spec/fb_graph/video_spec.rb
fb_graph-2.7.13 spec/fb_graph/video_spec.rb
fb_graph-2.7.12 spec/fb_graph/video_spec.rb
fb_graph-2.7.11 spec/fb_graph/video_spec.rb
fb_graph-2.7.10 spec/fb_graph/video_spec.rb
fb_graph-2.7.9 spec/fb_graph/video_spec.rb
fb_graph-2.7.8 spec/fb_graph/video_spec.rb
fb_graph-2.7.7 spec/fb_graph/video_spec.rb
fb_graph-2.7.6 spec/fb_graph/video_spec.rb
fb_graph-2.7.5 spec/fb_graph/video_spec.rb
fb_graph-2.7.4 spec/fb_graph/video_spec.rb
fb_graph-2.7.3 spec/fb_graph/video_spec.rb
fb_graph-2.7.2 spec/fb_graph/video_spec.rb
fb_graph-2.7.1 spec/fb_graph/video_spec.rb
fb_graph-2.7.0 spec/fb_graph/video_spec.rb
fb_graph-2.6.7 spec/fb_graph/video_spec.rb
fb_graph-2.6.6 spec/fb_graph/video_spec.rb