Sha256: 7b52c29f699ac08024caf3cffdcae16525f979a1471db58c160facdd7cbde8f6

Contents?: true

Size: 486 Bytes

Versions: 7

Compression:

Stored size: 486 Bytes

Contents

require 'spec_helper'

describe FbGraph2::User do
  describe '.me' do
    let(:klass) { FbGraph2::User }

    it 'should not call API' do
      expect do
        me = klass.me 'token'
        me.should be_instance_of klass
      end.not_to request_to 'me'
    end

    context 'when fetched' do
      it 'should call API' do
        me = mock_graph :get, 'me', 'user/me' do
          klass.me('token').fetch
        end
        me.should be_instance_of klass
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fb_graph2-0.0.11 spec/fb_graph2/user_spec.rb
fb_graph2-0.0.10 spec/fb_graph2/user_spec.rb
fb_graph2-0.0.9 spec/fb_graph2/user_spec.rb
fb_graph2-0.0.8 spec/fb_graph2/user_spec.rb
fb_graph2-0.0.7 spec/fb_graph2/user_spec.rb
fb_graph2-0.0.6 spec/fb_graph2/user_spec.rb
fb_graph2-0.0.5 spec/fb_graph2/user_spec.rb