Sha256: ef0fc3318177f2496b02c6802d9523be05ae139281c54d38e0eb479125685117

Contents?: true

Size: 1.29 KB

Versions: 56

Compression:

Stored size: 1.29 KB

Contents

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

describe FbGraph::Note, '.new' do

  it 'should setup all supported attributes' do
    attributes = {
      :id => '12345',
      :from => {
        :id => '23456',
        :name => 'nov matake'
      },
      :subject => 'TODO',
      :message => 'later or never',
      :created_time => '2010-01-02T15:37:40+0000',
      :updated_time => '2010-01-02T15:37:41+0000',
      :icon => 'http://static.ak.fbcdn.net/rsrc.php/z7NSY/hash/ajh5dbgz.gif'
    }
    note = FbGraph::Note.new(attributes.delete(:id), attributes)
    note.identifier.should   == '12345'
    note.from.should         == FbGraph::User.new('23456', :name => 'nov matake')
    note.subject.should      == 'TODO'
    note.message.should      == 'later or never'
    note.created_time.should == Time.parse('2010-01-02T15:37:40+0000')
    note.updated_time.should == Time.parse('2010-01-02T15:37:41+0000')
    note.icon.should         == 'http://static.ak.fbcdn.net/rsrc.php/z7NSY/hash/ajh5dbgz.gif'
  end

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

end

Version data entries

56 entries across 56 versions & 2 rubygems

Version Path
fb_graph-1.7.0 spec/fb_graph/note_spec.rb
fb_graph-1.7.0.alpha2 spec/fb_graph/note_spec.rb
fb_graph-1.6.9 spec/fb_graph/note_spec.rb
fb_graph-1.7.0.alpha spec/fb_graph/note_spec.rb
fb_graph-1.6.8 spec/fb_graph/note_spec.rb
fb_graph-1.6.7 spec/fb_graph/note_spec.rb
fb_graph-1.6.5 spec/fb_graph/note_spec.rb
fb_graph-1.6.4 spec/fb_graph/note_spec.rb
fb_graph-1.6.3 spec/fb_graph/note_spec.rb
fb_graph-1.6.2 spec/fb_graph/note_spec.rb
fb_graph-1.6.1 spec/fb_graph/note_spec.rb
fb_graph-1.6.0 spec/fb_graph/note_spec.rb
fb_graph-1.5.5 spec/fb_graph/note_spec.rb
fb_graph-1.5.4 spec/fb_graph/note_spec.rb
fb_graph-1.5.3 spec/fb_graph/note_spec.rb
fb_graph-1.5.2 spec/fb_graph/note_spec.rb
fb_graph-1.5.1 spec/fb_graph/note_spec.rb
fb_graph-1.5.0 spec/fb_graph/note_spec.rb
fb_graph-1.4.1 spec/fb_graph/note_spec.rb
fb_graph-1.4.0 spec/fb_graph/note_spec.rb