Skip to content

Instantly share code, notes, and snippets.

@chuckxD
Created June 21, 2012 18:34
Show Gist options
  • Save chuckxD/2967636 to your computer and use it in GitHub Desktop.
Save chuckxD/2967636 to your computer and use it in GitHub Desktop.
test 'exclude user if already triggered today with different hash' do
# default profile, user has email, viewed something yesterday
Cie::Data.profiles('Test').insert({'_id' => USER0, 'email' => EMAIL, 'timestamp' => YESTERDAY})
Cie::Data.views('Test').insert({'user_id' => USER0, 'SkuID' => SKU+'view-yesterday', 'timestamp' => YESTERDAY})
Cie::Data.triggers('Test').insert({'the_hash' => 'other', 'trigger_date' => Time.now, 'email_address' => EMAIL})
users = AbandonProduct.get_users('Test', 'h', 1, 0)
assert_equal(0, users.count)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment