Module: Panmind::BigBro::TestHelpers

Defined in:
lib/panmind/bigbro.rb

Instance Method Summary collapse

Instance Method Details

#assert_analyticsObject

Asserts the GA <script> tag, with not much effort; Asserts the noscript tag with the descendant img.



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/panmind/bigbro.rb', line 141

def assert_analytics
  host = BigBro.host_for(@request)

  assert_tag :tag => 'script', :content => /#{host}\/ga.js/

  assert_tag :tag => 'noscript',
    :descendant => {
      :tag => 'img',
      :attributes => {
        :src => /#{host}\/__utm.gif\?/,
        :border => '0',
        :alt => ''
      }
    }
end