Sha256: 40a83c415feeec8ea44772f91e3fd97647763d31681705e497013afac0141c9a

Contents?: true

Size: 1.42 KB

Versions: 71

Compression:

Stored size: 1.42 KB

Contents

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

describe FbGraph::Group, '.new' do

  it 'should setup all supported attributes' do
    attributes = {
      :id => '12345',
      :owner => {
        :id => '23456',
        :name => 'nov matake'
      },
      :name => 'group 1',
      :description => 'a group for fb_graph test',
      :link => 'http://www.facebook.com/group/12345',
      :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'
    }
    group = FbGraph::Group.new(attributes.delete(:id), attributes)
    group.identifier.should   == '12345'
    group.owner.should        == FbGraph::User.new('23456', :name => 'nov matake')
    group.name.should         == 'group 1'
    group.description.should  == 'a group for fb_graph test'
    group.link.should         == 'http://www.facebook.com/group/12345'
    group.venue.should        == FbGraph::Venue.new(
      :street => 'Sakuragaoka',
      :city => 'Shibuya',
      :state => 'Tokyo',
      :zip => '150-0031',
      :country => 'Japan',
      :latitude => '35.685',
      :longitude => '139.751'
    )
    group.privacy.should      == 'OPEN'
    group.updated_time.should == Time.parse('2010-01-02T15:37:41+0000')
  end

end

Version data entries

71 entries across 71 versions & 2 rubygems

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