Sha256: c211a6da77dff2867650e1e79d74304f73b5506aa28e13dcb53ec13eb9e423e8

Contents?: true

Size: 593 Bytes

Versions: 2

Compression:

Stored size: 593 Bytes

Contents

require "active_support/core_ext/string/output_safety"
require 'intercom-rails/script_tag_helper'
require 'minitest/autorun'

class IntercomRailsTest < MiniTest::Unit::TestCase
  include IntercomRails::ScriptTagHelper
  def test_output_is_html_safe?
    assert_equal true, intercom_script_tag({}).html_safe?
  end

  def test_converts_times_to_unix_timestamps
    now = Time.now
    assert_match(/.created_at.\s*:\s*#{now.to_i}/, intercom_script_tag({:created_at => now}))
    assert_match(/.something.\s*:\s*#{now.to_i}/, intercom_script_tag({:custom_data => {"something" => now}}))
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
intercom-rails-0.0.2 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.0.1 test/intercom-rails/script_tag_helper_test.rb