Sha256: bc60aa88f444e6b18f0321bd4d174502a7d5a4bd34249ed498f461594f1796bf

Contents?: true

Size: 991 Bytes

Versions: 71

Compression:

Stored size: 991 Bytes

Contents

require File.join(File.dirname(__FILE__), '../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

71 entries across 71 versions & 2 rubygems

Version Path
fb_graph-1.3.9 spec/fb_graph/status_spec.rb
fb_graph-1.3.8 spec/fb_graph/status_spec.rb
fb_graph-1.3.7 spec/fb_graph/status_spec.rb
fb_graph-1.3.6 spec/fb_graph/status_spec.rb
fb_graph-1.3.5 spec/fb_graph/status_spec.rb
fb_graph-1.3.4 spec/fb_graph/status_spec.rb
fb_graph-1.3.3 spec/fb_graph/status_spec.rb
fb_graph-1.3.2 spec/fb_graph/status_spec.rb
fb_graph-1.3.1 spec/fb_graph/status_spec.rb
fb_graph-1.3.0 spec/fb_graph/status_spec.rb
fb_graph-1.2.5 spec/fb_graph/status_spec.rb
fb_graph-1.2.4 spec/fb_graph/status_spec.rb
fb_graph-1.2.3 spec/fb_graph/status_spec.rb
fb_graph-1.2.2 spec/fb_graph/status_spec.rb
fb_graph-1.2.1 spec/fb_graph/status_spec.rb
fb_graph-1.2.0 spec/fb_graph/status_spec.rb
fb_graph-1.1.7 spec/fb_graph/status_spec.rb
fb_graph-1.1.6 spec/fb_graph/status_spec.rb
fb_graph-1.1.5 spec/fb_graph/status_spec.rb
fb_graph-1.1.4 spec/fb_graph/status_spec.rb