Sha256: 83d497dd003df3995dca26bf7353265edf9c8f5853771981ef71823a544a71d9

Contents?: true

Size: 871 Bytes

Versions: 17

Compression:

Stored size: 871 Bytes

Contents

require 'spec_helper'

describe FbGraph2::User do
  describe '.me' do
    it 'should not call API' do
      expect do
        me = described_class.me 'token'
        me.should be_instance_of described_class
      end.not_to request_to 'me'
    end

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

      context 'when ext attrs included' do
        it 'should success to parse' do
          me = mock_graph :get, 'me', 'user/me_with_ext_attrs' do
            described_class.me('token').fetch
          end
          [
            :age_range, :context, :currency, :devices
          ].each do |key|
            me.send(key).should be_present
          end
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
fb_graph2-1.3.0 spec/fb_graph2/user_spec.rb
fb_graph2-1.2.0 spec/fb_graph2/user_spec.rb
fb_graph2-1.1.1 spec/fb_graph2/user_spec.rb
fb_graph2-1.1.0 spec/fb_graph2/user_spec.rb
fb_graph2-1.0.1 spec/fb_graph2/user_spec.rb
fb_graph2-1.0.0 spec/fb_graph2/user_spec.rb
fb_graph2-0.9.1 spec/fb_graph2/user_spec.rb
fb_graph2-0.9.0 spec/fb_graph2/user_spec.rb
fb_graph2-0.8.0 spec/fb_graph2/user_spec.rb
fb_graph2-0.7.9 spec/fb_graph2/user_spec.rb
fb_graph2-0.7.8 spec/fb_graph2/user_spec.rb
fb_graph2-0.7.7 spec/fb_graph2/user_spec.rb
fb_graph2-0.7.6 spec/fb_graph2/user_spec.rb
fb_graph2-0.7.5 spec/fb_graph2/user_spec.rb
fb_graph2-0.7.4 spec/fb_graph2/user_spec.rb
fb_graph2-0.7.3 spec/fb_graph2/user_spec.rb
fb_graph2-0.7.2 spec/fb_graph2/user_spec.rb