Sha256: 1eb7385df43b3fa4be3f8d4a7ced6c4b39e5ee336f4186ff037c5c6c877af5ec

Contents?: true

Size: 732 Bytes

Versions: 8

Compression:

Stored size: 732 Bytes

Contents

require 'helper'
require 'omniauth/facebook/signed_request'

class SignedRequestTest < Minitest::Test
  def setup
    @value = fixture('signed_request.txt').strip
    @secret = "897z956a2z7zzzzz5783z458zz3z7556"
    @expected_payload = MultiJson.decode(fixture('payload.json'))
  end

  def test_signed_request_payload
    signed_request = OmniAuth::Facebook::SignedRequest.new(@value, @secret)
    assert_equal @expected_payload, signed_request.payload
  end

  def test_signed_request_parse
    payload = OmniAuth::Facebook::SignedRequest.parse(@value, @secret)
    assert_equal @expected_payload, payload
  end

  private

  def fixture(name)
    File.read(File.expand_path("fixtures/#{name}", File.dirname(__FILE__)))
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
omniauth-facebook-9.0.0 test/signed_request_test.rb
omniauth-facebook-8.0.0 test/signed_request_test.rb
omniauth-facebook-7.0.0 test/signed_request_test.rb
omniauth-facebook-6.0.0 test/signed_request_test.rb
omniauth-facebook-5.0.0 test/signed_request_test.rb
omniauth-facebook-4.0.0 test/signed_request_test.rb
omniauth-facebook-4.0.0.rc1 test/signed_request_test.rb
omniauth-facebook-3.0.0 test/signed_request_test.rb