Sha256: 11751b9d97930f09d4b80107ccaa5211fc930720f8ef3d888582ec081197cbe7

Contents?: true

Size: 953 Bytes

Versions: 109

Compression:

Stored size: 953 Bytes

Contents

require 'spec_helper'

describe FbGraph::Status, '.new' do

  it 'should setup all supported attributes' do
    attributes = {
      :id => '12345',
      :from => {
        :id => '23456',
        :name => 'nov matake'
      },
      :message => 'hello, how are you?',
      :updated_time => '2010-01-02T15:37:41+0000'
    }
    status = FbGraph::Status.new(attributes.delete(:id), attributes)
    status.identifier.should   == '12345'
    status.from.should         == FbGraph::User.new('23456', :name => 'nov matake')
    status.message.should      == 'hello, how are you?'
    status.updated_time.should == Time.parse('2010-01-02T15:37:41+0000')
  end

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

end

Version data entries

109 entries across 109 versions & 1 rubygems

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