Sha256: 86fd095297eca64864921b6ec183da757b22cff6a3f06141857a128bbe40983e
Contents?: true
Size: 1.48 KB
Versions: 10
Compression:
Stored size: 1.48 KB
Contents
require 'spec_helper' describe FbGraph::TaggedObject do let :attributes do MultiJson.load(json).with_indifferent_access end let :json do <<-JSON { "id": "1575327134", "name": "Jr Nov", "offset": 43, "length": 6 } JSON end it 'should setup all supported attributes' do tagged_object = FbGraph::TaggedObject.new attributes[:id], attributes tagged_object.identifier.should == '1575327134' tagged_object.name.should == 'Jr Nov' tagged_object.offset.should == 43 tagged_object.length.should == 6 end describe '#fetch' do context 'when tagged object is an User' do it 'should return User' do mock_graph :get, 'object_id', 'users/arjun_public' do object = FbGraph::TaggedObject.new('object_id').fetch object.should be_instance_of FbGraph::User end end end context 'when tagged object is a Page' do it 'should return Page' do mock_graph :get, 'object_id', 'pages/platform_public' do object = FbGraph::TaggedObject.new('object_id').fetch object.should be_instance_of FbGraph::Page end end end context 'when tagged object is an Application' do it 'should return Application' do mock_graph :get, 'object_id', 'applications/fbgraphsample' do object = FbGraph::TaggedObject.new('object_id').fetch object.should be_instance_of FbGraph::Application end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems