Sha256: 3ad89505e5317b5714b6c501ee2f85f9f6521ea6c1e5e6dcb0ee19f2655e244e

Contents?: true

Size: 736 Bytes

Versions: 5

Compression:

Stored size: 736 Bytes

Contents

require "test_helper"

describe Vanity::Helpers do
  describe "#track!" do
    it "identity option sets identity" do
      metric "Coolness"
      new_ab_test :foobar do
        alternatives "foo", "bar"
        default "foo"
        metrics :coolness
      end
      Vanity.track!(:coolness, identity: 'quux')

      assert_equal 1, experiment(:foobar).alternatives.sum(&:conversions)
    end

    it "accepts value for conversion" do
      metric "Coolness"
      new_ab_test :foobar do
        alternatives "foo", "bar"
        default "foo"
        metrics :coolness
      end
      Vanity.track!(:coolness, identity: 'quux', values: [2])

      assert_equal 2, experiment(:foobar).alternatives.sum(&:conversions)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vanity-4.0.4 test/helper_test.rb
vanity-4.0.3 test/helper_test.rb
vanity-4.0.2 test/helper_test.rb
vanity-4.0.1 test/helper_test.rb
vanity-4.0.0 test/helper_test.rb