Sha256: 643490c5974785acac08e401d50acc72410a360d51bf37e5d125aea418987531

Contents?: true

Size: 1.17 KB

Versions: 66

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'

describe FbGraph::QuestionOption do

  describe '.new' do
    it 'should setup all supported attributes' do
      attributes = {
        :id => '12345',
        :from => {
          :id => '23456',
          :name => 'Mahmoud Khaled'
        },
        :name => 'option 1',
        :votes => 5,
        :object => {:name => "Ruby programming language",
          :category => "Interest",
          :id => "109932262369283"
        },
        :created_time => '2009-12-29T15:24:50+0000'
      }
      question = FbGraph::QuestionOption.new(attributes.delete(:id), attributes)
      question.identifier.should        == '12345'
      question.from.should              == FbGraph::User.new('23456', :name => 'Mahmoud Khaled')
      question.name.should              == 'option 1'
      question.vote_count.should        == 5
      question.object.should            be_instance_of(FbGraph::Page)
      question.object.name.should       == "Ruby programming language"
      question.object.category.should   == "Interest"
      question.object.identifier.should == "109932262369283"
      question.created_time.should      == Time.parse('2009-12-29T15:24:50+0000')
    end

  end

end

Version data entries

66 entries across 66 versions & 1 rubygems

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