Sha256: 7919d3a7887f5eb9f650182361409037cb230c5919e51ae6f1ded30eb56a846e

Contents?: true

Size: 973 Bytes

Versions: 71

Compression:

Stored size: 973 Bytes

Contents

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

describe FbGraph::Comment, '.new' do

  it 'should setup all supported attributes' do
    attributes = {
      :id => '12345',
      :from => {
        :id => '23456',
        :name => 'nov matake'
      },
      :message => 'hello',
      :created_time => '2010-01-02T15:37:40+0000'
    }
    comment = FbGraph::Comment.new(attributes.delete(:id), attributes)
    comment.identifier.should   == '12345'
    comment.from.should         == FbGraph::User.new('23456', :name => 'nov matake')
    comment.message.should      == 'hello'
    comment.created_time.should == Time.parse('2010-01-02T15:37:40+0000')
  end

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

end

Version data entries

71 entries across 71 versions & 2 rubygems

Version Path
fb_graph-1.1.3 spec/fb_graph/comment_spec.rb
fb_graph-1.1.2 spec/fb_graph/comment_spec.rb
fb_graph-1.1.1 spec/fb_graph/comment_spec.rb
fb_graph-1.1.0 spec/fb_graph/comment_spec.rb
fb_graph-1.0.7 spec/fb_graph/comment_spec.rb
fb_graph-1.0.6 spec/fb_graph/comment_spec.rb
fb_graph-1.0.5 spec/fb_graph/comment_spec.rb
palidanx-fb_graph-1.0.4 spec/fb_graph/comment_spec.rb
fb_graph-1.0.4 spec/fb_graph/comment_spec.rb
fb_graph-1.0.3 spec/fb_graph/comment_spec.rb
fb_graph-1.0.2 spec/fb_graph/comment_spec.rb
fb_graph-1.0.1 spec/fb_graph/comment_spec.rb
fb_graph-1.0.0 spec/fb_graph/comment_spec.rb
fb_graph-0.8.0 spec/fb_graph/comment_spec.rb
fb_graph-0.7.3 spec/fb_graph/comment_spec.rb
fb_graph-0.7.2 spec/fb_graph/comment_spec.rb
fb_graph-0.7.1 spec/fb_graph/comment_spec.rb
fb_graph-0.7.0 spec/fb_graph/comment_spec.rb
fb_graph-0.6.0 spec/fb_graph/comment_spec.rb
fb_graph-0.5.0 spec/fb_graph/comment_spec.rb