1
0
Fork 0
mirror of https://github.com/simi/omniauth-facebook.git synced 2022-11-09 12:32:45 -05:00
simi--omniauth-facebook/test/signed_request_test.rb
2015-03-30 19:44:47 +02:00

26 lines
732 B
Ruby

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