spec/handler/google_analytics_spec.rb in rack-tracker-1.0.0 vs spec/handler/google_analytics_spec.rb in rack-tracker-1.0.1
- old
+ new
@@ -257,10 +257,10 @@
describe 'adjusted bounce rate' do
subject { described_class.new(env, tracker: 'afake', adjusted_bounce_rate_timeouts: [15, 30]).render }
it "will add timeouts to push read events" do
- expect(subject).to match(%r{ga\('send', 'event', '15_seconds', 'read'\)})
- expect(subject).to match(%r{ga\('send', 'event', '30_seconds', 'read'\)})
+ expect(subject).to include %q{setTimeout(function() { ga('send', 'event', '15_seconds', 'read'); },15000)}
+ expect(subject).to include %q{setTimeout(function() { ga('send', 'event', '30_seconds', 'read'); },30000)}
end
end
end