intercom-rails 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
@@ -94,7 +94,7 @@ module IntercomRails
|
|
94
94
|
end
|
95
95
|
|
96
96
|
def user_hash
|
97
|
-
OpenSSL::HMAC.hexdigest("sha256", secret, (user_details[:user_id] || user_details[:email]))
|
97
|
+
OpenSSL::HMAC.hexdigest("sha256", secret, (user_details[:user_id] || user_details[:email]).to_s)
|
98
98
|
end
|
99
99
|
|
100
100
|
def app_id
|
@@ -63,6 +63,8 @@ class ScriptTagTest < MiniTest::Unit::TestCase
|
|
63
63
|
IntercomRails.config.api_secret = 'abcd'
|
64
64
|
script_tag = ScriptTag.new(:user_details => {:email => 'ben@intercom.io'}, :secret => '1234')
|
65
65
|
assert_equal OpenSSL::HMAC.hexdigest("sha256", '1234', 'ben@intercom.io'), script_tag.intercom_settings[:user_hash]
|
66
|
+
script_tag = ScriptTag.new(:user_details => {:user_id => 5678}, :secret => '1234')
|
67
|
+
assert_equal OpenSSL::HMAC.hexdigest("sha256", '1234', '5678'), script_tag.intercom_settings[:user_hash]
|
66
68
|
end
|
67
69
|
|
68
70
|
def test_inbox_default_style
|