Sha256: 096042e61e3470713799ad965066bec4aed8ab0d2e12d2153df61de1e6d8d4f4

Contents?: true

Size: 1.03 KB

Versions: 20

Compression:

Stored size: 1.03 KB

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'
      note.access_token.should == 'valid'
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
fb_graph-1.0.7 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.0.6 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.0.5 spec/fb_graph/connections/notes_spec.rb
palidanx-fb_graph-1.0.4 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.0.4 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.0.3 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.0.2 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.0.1 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.0.0 spec/fb_graph/connections/notes_spec.rb
fb_graph-0.8.0 spec/fb_graph/connections/notes_spec.rb
fb_graph-0.7.3 spec/fb_graph/connections/notes_spec.rb
fb_graph-0.7.2 spec/fb_graph/connections/notes_spec.rb
fb_graph-0.7.1 spec/fb_graph/connections/notes_spec.rb
fb_graph-0.7.0 spec/fb_graph/connections/notes_spec.rb
fb_graph-0.6.0 spec/fb_graph/connections/notes_spec.rb
fb_graph-0.5.0 spec/fb_graph/connections/notes_spec.rb
fb_graph-0.4.2 spec/fb_graph/connections/notes_spec.rb
fb_graph-0.4.1 spec/fb_graph/connections/notes_spec.rb
fb_graph-0.4.0 spec/fb_graph/connections/notes_spec.rb
fb_graph-0.3.0 spec/fb_graph/connections/notes_spec.rb