Sha256: 54e0cebf0896e57931bf32e9c15a24ef2e3979feb8bb12f262c4a4ddc23a8afc
Contents?: true
Size: 1021 Bytes
Versions: 14
Compression:
Stored size: 1021 Bytes
Contents
require 'spec_helper' require 'base64' # FIXME: Looks like Facebook API changed recently and this test fails consistently now -RS 2018-03-05 xdescribe 'Facebook API example', type: :feature, js: true do before do proxy.stub('https://www.facebook.com:443/dialog/oauth').and_return(proc do |params, _, _| # mock a signed request from facebook. the JS api never verifies the # signature, so all it needs is the base64-encoded payload signed_request = "xxxxxxxxxx.#{Base64.encode64('{"user_id":"1234567"}')}" # redirect to the 'redirect_uri', with some extra crap in the query string { redirect_to: "#{params['redirect_uri'][0]}&access_token=foobar&expires_in=600&base_domain=localhost&https=1&signed_request=#{signed_request}" } end) proxy.stub('https://graph.facebook.com:443/me').and_return(jsonp: { name: 'Tester 1' }) end it 'should show me as logged-in' do visit '/facebook_api.html' click_on 'Login' expect(page).to have_content 'Hi, Tester 1' end end
Version data entries
14 entries across 14 versions & 1 rubygems