Sha256: 0b305e74c728faebd5ea4a23e9d8cc46a2b92dbdb719331f961c69c705f9a625

Contents?: true

Size: 792 Bytes

Versions: 1

Compression:

Stored size: 792 Bytes

Contents

require 'test_helper'

class IncludeTagTest < ActionView::TestCase

  test "should return include tag with id" do
    with_env 'production' do
      assert_equal "<script type=\"text/javascript\">var _gaq = _gaq || [];\n_gaq.push(['_setAccount', 'id']);\n_gaq.push(['_trackPageview']);\n(function(){\n  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n})();\n</script>", google_analytics_include_tag('id')
    end
  end

  private

  def with_env(value)
    old_env = Rails.env
    Rails.env = value
    yield
    Rails.env = old_env
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
analytics-rails-0.1.0 test/include_tag_test.rb