Sha256: d0a5115c1ee126f747e79e5c408b3716e1af981333efa0b58f067b383799c38a
Contents?: true
Size: 1.36 KB
Versions: 18
Compression:
Stored size: 1.36 KB
Contents
require 'spec_helper' describe TreasureData::Logger::Event do context 'preset' do let(:test_logger) do Fluent::Logger::TestLogger.new end before(:each) do t = test_logger TreasureData::Logger.module_eval do class_variable_set(:@@logger, t) end TD.event.attribute.clear end it 'action' do test_logger.should_receive(:post).with(:doit, {:action=>"doit", :foo=>:bar, :uid=>"uid1"}).twice TD.event.action(:doit, {:foo=>:bar}, "uid1") TD.event.attribute[:uid] = "uid1" TD.event.action(:doit, {:foo=>:bar}) end it 'register' do test_logger.should_receive(:post).with(:register, {:action=>"register", :uid=>"uid1"}).twice TD.event.register("uid1") TD.event.attribute[:uid] = "uid1" TD.event.register end it 'login' do test_logger.should_receive(:post).with(:login, {:action=>"login", :uid=>"uid1"}).twice TD.event.login("uid1") TD.event.attribute[:uid] = "uid1" TD.event.login end it 'pay' do test_logger.should_receive(:post).with(:pay, {:action=>"pay", :category=>"cat", :sub_category=>"subcat", :name=>"name", :price=>1980, :count=>1, :uid=>"uid1"}).twice TD.event.pay("cat", "subcat", "name", 1980, 1, "uid1") TD.event.attribute[:uid] = "uid1" TD.event.pay("cat", "subcat", "name", 1980, 1) end end end
Version data entries
18 entries across 18 versions & 1 rubygems