Sha256: ef4dba003730714c75b52e1b1e563e48894eee594f15bb29f9294ad867542775

Contents?: true

Size: 1.1 KB

Versions: 5

Compression:

Stored size: 1.1 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'
    }
    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 == '2010-01-02T15:37:40+0000'
    note.updated_time.should == '2010-01-02T15:37:41+0000'
  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

5 entries across 5 versions & 1 rubygems

Version Path
fb_graph-0.0.7 spec/fb_graph/note_spec.rb
fb_graph-0.0.6 spec/fb_graph/note_spec.rb
fb_graph-0.0.5 spec/fb_graph/note_spec.rb
fb_graph-0.0.4 spec/fb_graph/note_spec.rb
fb_graph-0.0.3 spec/fb_graph/note_spec.rb