Sha256: 7b0fa3d7c37bba88eded310176ce8e6db8e99987f02c93cecfc0c23946c4c5fb

Contents?: true

Size: 1.3 KB

Versions: 7

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper'

describe FbGraph2::TestUser do
  let(:app) { FbGraph2::App.app('app_token') }

  let(:test_user) do
    permissions = %w[public_profile,email,user_friends].join(',')
    mock_graph :post, 'app/accounts/test-users', 'post/test_users', access_token: 'app_token', permissions: permissions do
      app.test_user!
    end
  end

  describe '#access_token' do
    it 'should provide the TestUser access token' do
      test_user.access_token.should == 'test_user_token'
    end
  end

  describe '#password' do
    it 'should provide the new test user password' do
      test_user.password.should == 'test_user_password'
    end
  end

  describe '#login_url' do
    it 'should provide the new test user login_url' do
      test_user.login_url.should == 'https://developers.facebook.com/checkpoint/test-user-login/106444709796298/'
    end
  end

  describe '#friend!' do
    let(:test_friend) { FbGraph2::TestUser.new('123456789') }

    it 'should request and confirm the friendship for the given test user' do
      mock_graph :post, "#{test_user.id}/friends/#{test_friend.id}", 'success_true', access_token: test_user.access_token
      mock_graph :post, "#{test_friend.id}/friends/#{test_user.id}", 'success_true', access_token: test_friend.access_token
      test_user.friend!(test_friend)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fb_graph2-1.3.0 spec/fb_graph2/test_user_spec.rb
fb_graph2-1.2.0 spec/fb_graph2/test_user_spec.rb
fb_graph2-1.1.1 spec/fb_graph2/test_user_spec.rb
fb_graph2-1.1.0 spec/fb_graph2/test_user_spec.rb
fb_graph2-1.0.1 spec/fb_graph2/test_user_spec.rb
fb_graph2-1.0.0 spec/fb_graph2/test_user_spec.rb
fb_graph2-0.9.1 spec/fb_graph2/test_user_spec.rb