Sha256: 0b2dfe2a498c266f7f28ce197235aa2b6aff54ae2c562855aa4bda1320bc86fb

Contents?: true

Size: 1.12 KB

Versions: 4

Compression:

Stored size: 1.12 KB

Contents

require 'spec_helper'

describe FbGraph::Connections::Notes, '#notes' do
  context 'when included by FbGraph::User' do
    it 'should return notes as FbGraph::Note' do
      mock_graph :get, 'matake/notes', 'users/notes/matake_private', :params => {
        :access_token => 'access_token'
      } do
        notes = FbGraph::User.new('matake', :access_token => 'access_token').notes
        notes.each do |note|
          note.should be_instance_of(FbGraph::Note)
        end
      end
    end
  end
end

describe FbGraph::Connections::Notes, '#note!' do
  context 'when included by FbGraph::Page' do
    it 'should return generated note' do
      mock_graph :post, '12345/notes', 'pages/notes/post_with_valid_access_token', :params => {
        :access_token => 'valid',
        :subject => 'test',
        :message => 'hello'
      } do
        note = FbGraph::Page.new('12345', :access_token => 'valid').note!(:subject => 'test', :message => 'hello')
        note.identifier.should == 396664845100
        note.subject.should == 'test'
        note.message.should == 'hello'
        note.access_token.should == 'valid'
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fb_graph-1.7.5 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.7.4 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.7.3 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.7.2 spec/fb_graph/connections/notes_spec.rb