Sha256: c4e8318ba69f6a0df54aa93acd20230eb30d1cd827e13c8d7034833c6bbddf09

Contents?: true

Size: 797 Bytes

Versions: 28

Compression:

Stored size: 797 Bytes

Contents

require 'active_support/core_ext/string/output_safety'
require 'test_setup'

class ScriptTagHelperTest < MiniTest::Unit::TestCase

  include IntercomRails::ScriptTagHelper

  def test_delegates_to_script_tag_generate
    delegated = false
    IntercomRails::ScriptTag.stub(:generate) {
      delegated = true
    }

    intercom_script_tag({})
    assert(delegated, "should delegate to ScriptTag#generate")
  ensure
    IntercomRails::ScriptTag.rspec_reset
  end

  def test_sets_instance_variable
    fake_action_view = fake_action_view_class.new
    obj = Object.new

    fake_action_view.instance_variable_set(:@controller, obj)

    fake_action_view.intercom_script_tag({})
    assert_equal obj.instance_variable_get(IntercomRails::SCRIPT_TAG_HELPER_CALLED_INSTANCE_VARIABLE), true
  end

end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
intercom-rails-0.2.24 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.23 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.22 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.21 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.20 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.19 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.18 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.17 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.16 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.15 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.14 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.13 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.12 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.11 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.10 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.9 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.8 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.7 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.6 test/intercom-rails/script_tag_helper_test.rb
intercom-rails-0.2.5 test/intercom-rails/script_tag_helper_test.rb