Sha256: 97dcb9069aab3daa6c897a340e1c948f1700961edd8cee005d34cf831d339924

Contents?: true

Size: 1009 Bytes

Versions: 7

Compression:

Stored size: 1009 Bytes

Contents

require File.join(File.dirname(__FILE__), '../../spec_helper')

context 'when included by FbGraph::User' do
  describe FbGraph::Connections::Notes, '#notes' do
    before(:all) do
      fake_json(:get, 'matake/notes?access_token=access_token', 'users/notes/matake_private')
    end

    it 'should return notes as FbGraph::Note' 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

context 'when included by FbGraph::Page' do
  describe FbGraph::Connections::Notes, '#note!' do
    before do
      fake_json(:post, '12345/notes', 'pages/notes/post_with_valid_access_token')
    end

    it 'should return generated note' 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'
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fb_graph-0.2.2 spec/fb_graph/connections/notes_spec.rb
fb_graph-0.2.1 spec/fb_graph/connections/notes_spec.rb
fb_graph-0.2.0 spec/fb_graph/connections/notes_spec.rb
fb_graph-0.1.3 spec/fb_graph/connections/notes_spec.rb
fb_graph-0.1.2 spec/fb_graph/connections/notes_spec.rb
fb_graph-0.1.1 spec/fb_graph/connections/notes_spec.rb
fb_graph-0.1.0 spec/fb_graph/connections/notes_spec.rb