Sha256: 6625877dc48ca81ec36772b8afb1f21334944f91d41b52a20a2ec2290d451787

Contents?: true

Size: 1.02 KB

Versions: 37

Compression:

Stored size: 1.02 KB

Contents

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

describe FbGraph::Connections::Notes, '#notes' do
  context 'when included by FbGraph::User' do
    before 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

describe FbGraph::Connections::Notes, '#note!' do
  context 'when included by FbGraph::Page' 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

37 entries across 37 versions & 1 rubygems

Version Path
fb_graph-1.7.0 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.7.0.alpha2 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.6.9 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.7.0.alpha spec/fb_graph/connections/notes_spec.rb
fb_graph-1.6.8 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.6.7 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.6.5 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.6.4 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.6.3 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.6.2 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.6.1 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.6.0 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.5.5 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.5.4 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.5.3 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.5.2 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.5.1 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.5.0 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.4.1 spec/fb_graph/connections/notes_spec.rb
fb_graph-1.4.0 spec/fb_graph/connections/notes_spec.rb