Sha256: 8f0c20c5a32c51fc131cb9dbb7680d5e7a783e9e4b10ac86e17c11cf89657a95

Contents?: true

Size: 919 Bytes

Versions: 30

Compression:

Stored size: 919 Bytes

Contents

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

describe FbGraph::Tag, '.new' do

  it 'should setup all supported attributes' do
    attributes = {
      :id => "7901103",
      :name => "Arjun Banker",
      :x => 32.5,
      :y => 27.7778,
      :created_time => "2010-04-22T08:24:26+0000"
    }
    tag = FbGraph::Tag.new(attributes)
    tag.user.should == FbGraph::User.new('7901103', :name => "Arjun Banker")
    tag.name.should == 'Arjun Banker'
    tag.x.should == 32.5
    tag.y.should == 27.7778
    tag.created_time.should == Time.parse("2010-04-22T08:24:26+0000")
  end

  it 'should not setup user if id is blank' do
    attributes = {
      :id => "",
      :name => "Arjun Banker",
      :x => 32.5,
      :y => 27.7778,
      :created_time => "2010-04-22T08:24:26+0000"
    }
    tag = FbGraph::Tag.new(attributes)
    tag.user.should be_nil
    tag.name.should == 'Arjun Banker'
  end

end

Version data entries

30 entries across 30 versions & 1 rubygems

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