require File.expand_path('../../spec_helper', __FILE__) describe Yammer::Api::Search do before :all do @client = Yammer::Client.new( :site_url => 'https://www.yammer.com', :client_id => 'PRbTcg9qjgKsp4jjpm1pw', :client_secret => 'Xn7kp7Ly0TCY4GtZWkmSsqGEPg10DmMADyjWkf2U', :access_token => 'TolNOFka9Uls2DxahNi78A' ) end subject { @client } describe '#open graph object' do it 'should create open graph object' do ogo_url = 'http://www.example.com' ogo_props = { :site_name => 'Microsoft', :image => 'https://example.com/global/images/test.jpg' } subject.should_receive(:post).with('/api/v1/open_graph_objects', { :url=>"http://www.example.com", :properites => { :site_name => "Microsoft", :image => "https://example.com/global/images/test.jpg" } }) subject.create_open_graph_object(ogo_url, ogo_props) end it 'should follow open graph object' do subject.should_receive(:post).with('/api/v1/subscriptions', :target_id => 7, :target_type => 'OpenGraphObject') subject.follow_open_graph_object(7) end it 'should follow opnen graph object' do subject.should_receive(:get).with('/api/v1/subscriptions/to_open_graph_object/5') subject.is_following_open_graph_object?(5) end it 'should fetch open graph objects in user activity stream' do subject.should_receive(:get).with('/api/v1/streams/activities', :owner_type => 'open_graph_object', :owner_id => 4) subject.get_activity_stream_open_graph_objects(4) end end end