Sha256: fc3d829c37573eed3a0133d6a11d0ff1632826acab5748b46070950cb54ad154

Contents?: true

Size: 1.59 KB

Versions: 5

Compression:

Stored size: 1.59 KB

Contents

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

describe FbGraph::Event, '#new' do

  it 'should setup all supported attributes' do
    attributes = {
      :id => '12345',
      :owner => {
        :id => '23456',
        :name => 'nov matake'
      },
      :name => 'event 1',
      :description => 'an event for fb_graph test',
      :start_time => '2010-03-14T21:00:00+0000',
      :end_time => '2010-03-15T00:30:00+0000',
      :location => 'Smart.fm office',
      :venue => {
        :street => 'Sakuragaoka',
        :city => 'Shibuya',
        :state => 'Tokyo',
        :zip => '150-0031',
        :country => 'Japan',
        :latitude => '35.685',
        :longitude => '139.751'
      },
      :privacy => 'OPEN',
      :updated_time => '2010-01-02T15:37:41+0000'
    }
    event = FbGraph::Event.new(attributes.delete(:id), attributes)
    event.identifier.should   == '12345'
    event.owner.should        == FbGraph::User.new('23456', :name => 'nov matake')
    event.name.should         == 'event 1'
    event.description.should  == 'an event for fb_graph test'
    event.start_time.should   == '2010-03-14T21:00:00+0000'
    event.end_time.should     == '2010-03-15T00:30:00+0000'
    event.location.should     == 'Smart.fm office'
    event.venue.should        == FbGraph::Venue.new(
      :street => 'Sakuragaoka',
      :city => 'Shibuya',
      :state => 'Tokyo',
      :zip => '150-0031',
      :country => 'Japan',
      :latitude => '35.685',
      :longitude => '139.751'
    )
    event.privacy.should      == 'OPEN'
    event.updated_time.should == '2010-01-02T15:37:41+0000'
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

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