Sha256: 2db686d8aaf60f454226e0f98a8392764df4c2e4063ba196edc0a4fcba493a57

Contents?: true

Size: 935 Bytes

Versions: 93

Compression:

Stored size: 935 Bytes

Contents

require '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

93 entries across 93 versions & 1 rubygems

Version Path
fb_graph-2.4.20 spec/fb_graph/comment_spec.rb
fb_graph-2.4.19 spec/fb_graph/comment_spec.rb
fb_graph-2.4.18 spec/fb_graph/comment_spec.rb
fb_graph-2.4.17 spec/fb_graph/comment_spec.rb
fb_graph-2.4.16 spec/fb_graph/comment_spec.rb
fb_graph-2.4.15 spec/fb_graph/comment_spec.rb
fb_graph-2.4.14 spec/fb_graph/comment_spec.rb
fb_graph-2.4.13 spec/fb_graph/comment_spec.rb
fb_graph-2.4.12 spec/fb_graph/comment_spec.rb
fb_graph-2.4.11 spec/fb_graph/comment_spec.rb
fb_graph-2.4.10 spec/fb_graph/comment_spec.rb
fb_graph-2.4.9 spec/fb_graph/comment_spec.rb
fb_graph-2.4.8 spec/fb_graph/comment_spec.rb
fb_graph-2.4.7 spec/fb_graph/comment_spec.rb
fb_graph-2.4.6 spec/fb_graph/comment_spec.rb
fb_graph-2.4.4 spec/fb_graph/comment_spec.rb
fb_graph-2.4.3 spec/fb_graph/comment_spec.rb
fb_graph-2.4.2 spec/fb_graph/comment_spec.rb
fb_graph-2.4.1 spec/fb_graph/comment_spec.rb
fb_graph-2.4.0 spec/fb_graph/comment_spec.rb