Sha256: 33db1376f0cd6ee2c58d1a74af564760b48d3ab1e6f1090ba697c341603caa9f

Contents?: true

Size: 1.48 KB

Versions: 5

Compression:

Stored size: 1.48 KB

Contents

require File.expand_path('../test_helper', __FILE__)

module Tamber
  class EventTest < Test::Unit::TestCase
    should "be trackable" do
      begin
        e = Tamber::Event.track(
          :user => 'user_jctzgisbru',
          :item =>  'item_i5gq90scc1',
          :behavior => 'mention',
          :hit => true,
          :context => ['recommended', 'detail-view'],
          :get_recs => {}
        )
        puts e
      end
    end

    should "be retrievable" do
      begin
        e = Tamber::Event.retrieve(
          :user => 'user_jctzgisbru',
        )
        puts e
      end
    end

    should "be batchable" do
      begin
        e = Tamber::Event.batch(
          :events => [
            {
              :user => 'user_y7u9sv6we0',
              :item => 'item_u9nlytt3w5',
              :behavior => 'mention'
            },
            {
              :user => 'user_y7u9sv6we0',
              :item => 'item_i5gq90scc1',
              :behavior => 'mention'
            }
          ]
        )
        puts e
      end
    end

    should "track meta like" do
      begin
        e = Tamber::Event.metaLike(
          :user => 'user_jctzgisbru',
          :property =>  'genre',
          :value => 'sci-fi'
        )
        puts e
      end
    end

    should "untrack meta like" do
      begin
        e = Tamber::Event.metaUnlike(
          :user => 'user_jctzgisbru',
          :property =>  'genre',
          :value => 'sci-fi'
        )
        puts e
      end
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tamber-0.1.13 test/event_test.rb
tamber-0.1.12 test/event_test.rb
tamber-0.1.11 test/event_test.rb
tamber-0.1.10 test/event_test.rb
tamber-0.1.9 test/event_test.rb