Sha256: 06f11ab34b6e36bce6eb3c97ef846035b3ee9ed74a0db02efa7536ab71f6ee0a

Contents?: true

Size: 1.1 KB

Versions: 3

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'

describe FbGraph2::Edge::TestUsers do
  context 'included in App' do
    let(:app) { FbGraph2::App.app('app_token') }

    describe '#test_users' do
      it 'should return an Array of FbGraph2::User with test_user token' do
        users = mock_graph :get, 'app/accounts/test-users', 'app/test_users', access_token: 'app_token' do
          app.test_users
        end
        users.should be_instance_of FbGraph2::Edge
        users.should_not be_blank
        users.each do |user|
          user.should be_instance_of FbGraph2::User
          user.access_token.should == 'test_user_token'
        end
      end
    end

    describe '#test_user!' do
      it 'should create an Object of FbGraph2::User with test_user token' do
        permissions = %w[public_profile,email,user_friends].join(',')
        user = mock_graph :post, 'app/accounts/test-users', 'post/test_users', access_token: 'app_token', permissions: permissions do
          app.test_user!
        end
        user.should be_instance_of FbGraph2::User
        user.access_token.should == 'test_user_token'
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fb_graph2-0.9.0 spec/fb_graph2/edge/test_users_spec.rb
fb_graph2-0.8.0 spec/fb_graph2/edge/test_users_spec.rb
fb_graph2-0.7.9 spec/fb_graph2/edge/test_users_spec.rb