<commit_before>rewire = require 'rewire'
rewiredAnalytics = rewire '../../lib/analytics'
analytics = require '../../lib/analytics'
Artwork = require '../../models/artwork'
sinon = require 'sinon'
sd = require('sharify').data
benv = require 'benv'
_ = require 'underscore'

describe 'analytics', ->

  describe 'with a standard useragent', ->

    before ->
      sinon.stub(analytics, 'getUserAgent').returns "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.102 Safari/537.36"

    after ->
      analytics.getUserAgent.restore()

    beforeEach ->
      sd.MIXPANEL_ID = 'mix that panel'
      sd.GOOGLE_ANALYTICS_ID = 'goog that analytics'
      sd.SNOWPLOW_COLLECTOR_HOST = 'plow that snow'
      @mixpanelStub = { get_property: sinon.stub(), register_once: sinon.stub() }
      @mixpanelStub.track = sinon.stub()
      @mixpanelStub.register = sinon.stub()
      @mixpanelStub.init = sinon.stub()
      @snowplowStub = sinon.stub()

      @gaStub = sinon.stub()<commit_msg>fix analytics test<commit_after>rewire = require 'rewire'
rewiredAnalytics = rewire '../../lib/analytics'
analytics = require '../../lib/analytics'
Artwork = require '../../models/artwork'
sinon = require 'sinon'
sd = require('sharify').data
benv = require 'benv'
_ = require 'underscore'

describe 'analytics', ->

  describe 'with a standard useragent', ->

    before ->
      sinon.stub(analytics, 'getUserAgent').returns "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.102 Safari/537.36"
      @clock = sinon.useFakeTimers();

    after ->
      analytics.getUserAgent.restore()
      @clock.restore()

    beforeEach ->
      sd.MIXPANEL_ID = 'mix that panel'
      sd.GOOGLE_ANALYTICS_ID = 'goog that analytics'
      sd.SNOWPLOW_COLLECTOR_HOST = 'plow that snow'
      @mixpanelStub = { get_property: sinon.stub(), register_once: sinon.stub() }
      @mixpanelStub.track = sinon.stub()
      @mixpanelStub.register = sinon.stub()
      @mixpanelStub.init = sinon.stub()
      @snowplowStub = sinon.stub()

      @gaStub = sinon.stub()
{'fraction_non_alphanumeric': 0.14460093896713616, 'fraction_numerical': 0.024413145539906103, 'mean_word_length': 3.270541082164329, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7455424', 'n_tokens_mistral': 775, 'n_tokens_neox': 758, 'n_words': 154}