Sha256: e67ac2e5fc75a955d81e4718d7db9764768b09d362d556116e070ec90b1258af

Contents?: true

Size: 881 Bytes

Versions: 109

Compression:

Stored size: 881 Bytes

Contents

require '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

109 entries across 109 versions & 1 rubygems

Version Path
fb_graph-2.7.17 spec/fb_graph/tag_spec.rb
fb_graph-2.7.16 spec/fb_graph/tag_spec.rb
fb_graph-2.7.15 spec/fb_graph/tag_spec.rb
fb_graph-2.7.14 spec/fb_graph/tag_spec.rb
fb_graph-2.7.13 spec/fb_graph/tag_spec.rb
fb_graph-2.7.12 spec/fb_graph/tag_spec.rb
fb_graph-2.7.11 spec/fb_graph/tag_spec.rb
fb_graph-2.7.10 spec/fb_graph/tag_spec.rb
fb_graph-2.7.9 spec/fb_graph/tag_spec.rb
fb_graph-2.7.8 spec/fb_graph/tag_spec.rb
fb_graph-2.7.7 spec/fb_graph/tag_spec.rb
fb_graph-2.7.6 spec/fb_graph/tag_spec.rb
fb_graph-2.7.5 spec/fb_graph/tag_spec.rb
fb_graph-2.7.4 spec/fb_graph/tag_spec.rb
fb_graph-2.7.3 spec/fb_graph/tag_spec.rb
fb_graph-2.7.2 spec/fb_graph/tag_spec.rb
fb_graph-2.7.1 spec/fb_graph/tag_spec.rb
fb_graph-2.7.0 spec/fb_graph/tag_spec.rb
fb_graph-2.6.7 spec/fb_graph/tag_spec.rb
fb_graph-2.6.6 spec/fb_graph/tag_spec.rb