Sha256: cf02ed7b3d03bc6fdf566189f7e4566ef229e96fa833a13c40ca0348bc38048c

Contents?: true

Size: 739 Bytes

Versions: 17

Compression:

Stored size: 739 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

17 entries across 17 versions & 1 rubygems

Version Path
vanity-3.1.0 test/helper_test.rb
vanity-3.0.2 test/helper_test.rb
vanity-3.0.1 test/helper_test.rb
vanity-3.0.0 test/helper_test.rb
vanity-2.2.10 test/helper_test.rb
vanity-2.2.9 test/helper_test.rb
vanity-2.2.8 test/helper_test.rb
vanity-2.2.7 test/helper_test.rb
vanity-2.2.6 test/helper_test.rb
vanity-2.2.4 test/helper_test.rb
vanity-2.2.3 test/helper_test.rb
vanity-2.2.2 test/helper_test.rb
vanity-2.2.1 test/helper_test.rb
vanity-2.2.0 test/helper_test.rb
vanity-2.1.2 test/helper_test.rb
vanity-2.1.1 test/helper_test.rb
vanity-2.1.0 test/helper_test.rb