     "is-splittest-#{@key}--#{@outcome()}"
 
   admin: ->
-    sd.CURRENT_USER?.type is 'Admin'
+    CURRENT_USER?.type is 'Admin'
 
   toss: ->
     _.sample _.flatten _.map @outcomes, (probability, outcome) ->

_ = require 'underscore'
Backbone = require 'backbone'
Cookies = require 'cookies-js'
sd = require('sharify').data
{ getProperty, setProperty, unsetProperty, setDimension } = require '../../lib/analytics.coffee'

module.exports = class SplitTest
  constructor: ({ @key, @outcomes, @edge, @dimension }) ->

  _key: ->
    "split_test--#{@key}"

  cookies: ->
    if IS_TEST_ENV
      set: (->), get: (->), expire: (->)
    else
      @__cookies__ ?= require 'cookies-js'

  set: (outcome) ->
    @cookies().set @_key(), outcome
    unsetProperty @_key() # Force unset
    setProperty _.tap({}, (hsh) => hsh[@_key()] = outcome)
    setDimension @dimension, outcome if @dimension?
    outcome

  get: ->
    getProperty(@_key()) or @cookies().get(@_key())

  unset: ->
    @cookies().expire @_key()
    unsetProperty @_key()
    location.reload()

