Create HoudIDs for stringy ids
This commit is contained in:
parent
a7a4ce1f50
commit
e806d8764f
16 changed files with 71 additions and 44 deletions
|
@ -4,7 +4,7 @@
|
||||||
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
||||||
class CampaignGiftOption < ApplicationRecord
|
class CampaignGiftOption < ApplicationRecord
|
||||||
include ObjectEvent::ModelExtensions
|
include ObjectEvent::ModelExtensions
|
||||||
object_eventable
|
object_eventable :cgo
|
||||||
# :amount_one_time, #int (cents)
|
# :amount_one_time, #int (cents)
|
||||||
# :amount_recurring, #int (cents)
|
# :amount_recurring, #int (cents)
|
||||||
# :amount_dollars, #str, gets converted to amount
|
# :amount_dollars, #str, gets converted to amount
|
||||||
|
|
|
@ -4,14 +4,21 @@
|
||||||
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
||||||
module ObjectEvent::ModelExtensions
|
module ObjectEvent::ModelExtensions
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
class_methods do
|
class_methods do
|
||||||
|
|
||||||
# Adds the to_event method to a model. Requires `to_builder` method for creating
|
# Adds the to_event method to a model. Requires `to_builder` method for creating
|
||||||
# the Jbuilder object
|
# the Jbuilder object
|
||||||
def object_eventable
|
def object_eventable(prefix)
|
||||||
class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
||||||
|
def object_prefix
|
||||||
|
:#{prefix.to_s}
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def to_event(event_type, *expand)
|
def to_event(event_type, *expand)
|
||||||
Jbuilder.new do |event|
|
Jbuilder.new do |event|
|
||||||
event.id SecureRandom.uuid
|
event.id "objevt_" + SecureRandom.alphanumeric(22)
|
||||||
event.object 'object_event'
|
event.object 'object_event'
|
||||||
event.type event_type
|
event.type event_type
|
||||||
event.data do
|
event.data do
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
||||||
class EventDiscount < ApplicationRecord
|
class EventDiscount < ApplicationRecord
|
||||||
include ObjectEvent::ModelExtensions
|
include ObjectEvent::ModelExtensions
|
||||||
object_eventable
|
object_eventable :evtdisc
|
||||||
# :code,
|
# :code,
|
||||||
# :event_id,
|
# :event_id,
|
||||||
# :name,
|
# :name,
|
||||||
|
|
|
@ -180,7 +180,7 @@ class Supporter < ApplicationRecord
|
||||||
# we do something custom here since Supporter and SupporterAddress are in the same model
|
# we do something custom here since Supporter and SupporterAddress are in the same model
|
||||||
def to_event(event_type, *expand)
|
def to_event(event_type, *expand)
|
||||||
Jbuilder.new do |event|
|
Jbuilder.new do |event|
|
||||||
event.id SecureRandom.uuid
|
event.id "objevt_" + SecureRandom.alphanumeric(22)
|
||||||
event.object 'object_event'
|
event.object 'object_event'
|
||||||
event.type event_type
|
event.type event_type
|
||||||
event.data do
|
event.data do
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
||||||
class SupporterNote < ApplicationRecord
|
class SupporterNote < ApplicationRecord
|
||||||
include ObjectEvent::ModelExtensions
|
include ObjectEvent::ModelExtensions
|
||||||
object_eventable
|
object_eventable :suppnote
|
||||||
# :content,
|
# :content,
|
||||||
# :supporter_id, :supporter
|
# :supporter_id, :supporter
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
||||||
class TagMaster < ApplicationRecord
|
class TagMaster < ApplicationRecord
|
||||||
include ObjectEvent::ModelExtensions
|
include ObjectEvent::ModelExtensions
|
||||||
object_eventable
|
object_eventable :tagmstr
|
||||||
# TODO replace with Discard gem
|
# TODO replace with Discard gem
|
||||||
define_model_callbacks :discard
|
define_model_callbacks :discard
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
||||||
class TicketLevel < ApplicationRecord
|
class TicketLevel < ApplicationRecord
|
||||||
include ObjectEvent::ModelExtensions
|
include ObjectEvent::ModelExtensions
|
||||||
object_eventable
|
object_eventable :tktlvl
|
||||||
# :amount, #integer
|
# :amount, #integer
|
||||||
# :amount_dollars, #accessor, string
|
# :amount_dollars, #accessor, string
|
||||||
# :name, #string
|
# :name, #string
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
// License: LGPL-3.0-or-later
|
// License: LGPL-3.0-or-later
|
||||||
import type { Amount, HoudiniObject, IdType, UuidType } from "../common";
|
import type { Amount, HoudiniObject, IdType, HoudID } from "../common";
|
||||||
import type Nonprofit from './';
|
import type Nonprofit from './';
|
||||||
|
|
||||||
|
|
||||||
export interface Transaction extends HoudiniObject<UuidType> {
|
export interface Transaction extends HoudiniObject<HoudID> {
|
||||||
amount: Amount;
|
amount: Amount;
|
||||||
nonprofit: IdType | Nonprofit;
|
nonprofit: IdType | Nonprofit;
|
||||||
object: 'transaction';
|
object: 'transaction';
|
||||||
|
|
|
@ -9,7 +9,7 @@ export type IdType = number;
|
||||||
/**
|
/**
|
||||||
* an identifier for HoudiniObjects which is unique among all HoudiniObjects.
|
* an identifier for HoudiniObjects which is unique among all HoudiniObjects.
|
||||||
*/
|
*/
|
||||||
export type UuidType = string;
|
export type HoudID = string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes a monetary value in the minimum unit for this current. Corresponds to Money class in
|
* Describes a monetary value in the minimum unit for this current. Corresponds to Money class in
|
||||||
|
@ -60,7 +60,7 @@ export type RecurrenceRule = {
|
||||||
* Every object controlled by the Houdini event publisher must meet this standard interface
|
* Every object controlled by the Houdini event publisher must meet this standard interface
|
||||||
* and will inherit from it.
|
* and will inherit from it.
|
||||||
*/
|
*/
|
||||||
export interface HoudiniObject<Id extends IdType|UuidType=IdType> {
|
export interface HoudiniObject<Id extends IdType|HoudID=IdType> {
|
||||||
/**
|
/**
|
||||||
* An IdType which unique which uniquely identifies this object
|
* An IdType which unique which uniquely identifies this object
|
||||||
* from all other similar objects
|
* from all other similar objects
|
||||||
|
@ -73,7 +73,7 @@ export interface HoudiniObject<Id extends IdType|UuidType=IdType> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type HoudiniObjectOfAllIds = HoudiniObject<IdType> | HoudiniObject<UuidType>;
|
type HoudiniObjectOfAllIds = HoudiniObject<IdType> | HoudiniObject<HoudID>;
|
||||||
/**
|
/**
|
||||||
* An event published by Houdini
|
* An event published by Houdini
|
||||||
*
|
*
|
||||||
|
@ -90,9 +90,9 @@ export interface HoudiniEvent<EventType extends string, DataObject extends Houdi
|
||||||
object: DataObject;
|
object: DataObject;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* A UUID uniquely representing the event
|
* A HoudID uniquely representing the event
|
||||||
*/
|
*/
|
||||||
id: string;
|
id: HoudID;
|
||||||
object: 'object_event';
|
object: 'object_event';
|
||||||
/** The type of event that this is */
|
/** The type of event that this is */
|
||||||
type: EventType;
|
type: EventType;
|
||||||
|
|
|
@ -43,7 +43,7 @@ RSpec.describe CampaignGiftOption, type: :model do
|
||||||
it 'announces create for first example' do
|
it 'announces create for first example' do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_create, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_create, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_created, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_created, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'campaign_gift_option.created',
|
'type' => 'campaign_gift_option.created',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -84,7 +84,7 @@ RSpec.describe CampaignGiftOption, type: :model do
|
||||||
it 'announces create for second example' do
|
it 'announces create for second example' do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_create, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_create, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_created, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_created, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'campaign_gift_option.created',
|
'type' => 'campaign_gift_option.created',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -146,7 +146,7 @@ RSpec.describe CampaignGiftOption, type: :model do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_create, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_create, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_created, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_updated, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_updated, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'campaign_gift_option.updated',
|
'type' => 'campaign_gift_option.updated',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -191,7 +191,7 @@ RSpec.describe CampaignGiftOption, type: :model do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_create, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_create, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_created, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_updated, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_updated, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'campaign_gift_option.updated',
|
'type' => 'campaign_gift_option.updated',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -238,7 +238,7 @@ RSpec.describe CampaignGiftOption, type: :model do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_create, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_create, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_created, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_deleted, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_deleted, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'campaign_gift_option.deleted',
|
'type' => 'campaign_gift_option.deleted',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -285,7 +285,7 @@ RSpec.describe CampaignGiftOption, type: :model do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_create, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_create, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_created, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_deleted, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:campaign_gift_option_deleted, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'campaign_gift_option.deleted',
|
'type' => 'campaign_gift_option.deleted',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
|
|
@ -9,12 +9,12 @@ RSpec.describe ObjectEvent::ModelExtensions do
|
||||||
let(:event_type) {'model.event_name'}
|
let(:event_type) {'model.event_name'}
|
||||||
class ClassWithoutToBuilder
|
class ClassWithoutToBuilder
|
||||||
include ObjectEvent::ModelExtensions
|
include ObjectEvent::ModelExtensions
|
||||||
object_eventable
|
object_eventable :cwotb
|
||||||
end
|
end
|
||||||
|
|
||||||
class ClassWithToBuilder
|
class ClassWithToBuilder
|
||||||
include ObjectEvent::ModelExtensions
|
include ObjectEvent::ModelExtensions
|
||||||
object_eventable
|
object_eventable :cwtb
|
||||||
|
|
||||||
def to_builder(*expand)
|
def to_builder(*expand)
|
||||||
Jbuilder.new do |json|
|
Jbuilder.new do |json|
|
||||||
|
@ -23,15 +23,19 @@ RSpec.describe ObjectEvent::ModelExtensions do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
it 'raises NotImplementedError when no to_builder is defined by developer' do
|
it 'raises NotImplementedError when no to_builder is defined by developer' do
|
||||||
obj = ClassWithoutToBuilder.new
|
obj = ClassWithoutToBuilder.new
|
||||||
|
expect(obj.object_prefix).to eq :cwotb
|
||||||
expect { obj.to_event event_type}.to raise_error(NotImplementedError)
|
expect { obj.to_event event_type}.to raise_error(NotImplementedError)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns an proper event when to_builder is defined by developer' do
|
it 'returns an proper event when to_builder is defined by developer' do
|
||||||
obj = ClassWithToBuilder.new
|
obj = ClassWithToBuilder.new
|
||||||
|
expect(obj.object_prefix).to eq :cwtb
|
||||||
expect(obj.to_event event_type).to eq({
|
expect(obj.to_event event_type).to eq({
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => event_type,
|
'type' => event_type,
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -41,4 +45,19 @@ RSpec.describe ObjectEvent::ModelExtensions do
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'raises without object_prefix' do
|
||||||
|
expect do
|
||||||
|
class ClassWithoutEventablePrefix
|
||||||
|
include ObjectEvent::ModelExtensions
|
||||||
|
object_eventable
|
||||||
|
|
||||||
|
def to_builder(*expand)
|
||||||
|
Jbuilder.new do |json|
|
||||||
|
json.id 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end.to raise_error(ArgumentError)
|
||||||
|
end
|
||||||
end
|
end
|
|
@ -54,7 +54,7 @@ RSpec.describe EventDiscount, type: :model do
|
||||||
it 'announces create' do
|
it 'announces create' do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_created, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:event_discount_created, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:event_discount_created, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'event_discount.created',
|
'type' => 'event_discount.created',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -116,7 +116,7 @@ RSpec.describe EventDiscount, type: :model do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_created, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:event_discount_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:event_discount_created, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:event_discount_updated, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:event_discount_updated, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'event_discount.updated',
|
'type' => 'event_discount.updated',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -179,7 +179,7 @@ RSpec.describe EventDiscount, type: :model do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_created, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:event_discount_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:event_discount_created, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:event_discount_deleted, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:event_discount_deleted, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'event_discount.deleted',
|
'type' => 'event_discount.deleted',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
|
|
@ -34,7 +34,7 @@ RSpec.describe SupporterNote, type: :model do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_created, anything)
|
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_created, anything)
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_address_created, anything)
|
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_address_created, anything)
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_note_created, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_note_created, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'supporter_note.created',
|
'type' => 'supporter_note.created',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -65,7 +65,7 @@ RSpec.describe SupporterNote, type: :model do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_address_created, anything)
|
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_address_created, anything)
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_note_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_note_created, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_note_updated, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_note_updated, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'supporter_note.updated',
|
'type' => 'supporter_note.updated',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -98,7 +98,7 @@ RSpec.describe SupporterNote, type: :model do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_address_created, anything)
|
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_address_created, anything)
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_note_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_note_created, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_note_deleted, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_note_deleted, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'supporter_note.deleted',
|
'type' => 'supporter_note.deleted',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
|
|
@ -61,7 +61,7 @@ RSpec.describe Supporter, type: :model do
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_created, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_created, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'supporter.created',
|
'type' => 'supporter.created',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -89,7 +89,7 @@ RSpec.describe Supporter, type: :model do
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_deleted, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_deleted, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'supporter.deleted',
|
'type' => 'supporter.deleted',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -111,7 +111,7 @@ RSpec.describe Supporter, type: :model do
|
||||||
|
|
||||||
|
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_address_created, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_address_created, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'supporter_address.created',
|
'type' => 'supporter_address.created',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -139,7 +139,7 @@ RSpec.describe Supporter, type: :model do
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_address_deleted, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_address_deleted, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'supporter_address.deleted',
|
'type' => 'supporter_address.deleted',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -157,7 +157,8 @@ RSpec.describe Supporter, type: :model do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_created, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_address_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_address_created, anything).ordered
|
||||||
|
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_updated, { 'id' => kind_of(String),
|
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_updated, {
|
||||||
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'supporter.updated',
|
'type' => 'supporter.updated',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -180,7 +181,7 @@ RSpec.describe Supporter, type: :model do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_address_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_address_created, anything).ordered
|
||||||
|
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_address_updated, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:supporter_address_updated, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'supporter_address.updated',
|
'type' => 'supporter_address.updated',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
|
|
@ -15,7 +15,7 @@ RSpec.describe TagMaster, type: :model do
|
||||||
|
|
||||||
it 'announces create' do
|
it 'announces create' do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:tag_master_created, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:tag_master_created, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'tag_master.created',
|
'type' => 'tag_master.created',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -35,7 +35,7 @@ RSpec.describe TagMaster, type: :model do
|
||||||
it 'announces deleted' do
|
it 'announces deleted' do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:tag_master_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:tag_master_created, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:tag_master_deleted, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:tag_master_deleted, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'tag_master.deleted',
|
'type' => 'tag_master.deleted',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
|
|
@ -44,7 +44,7 @@ RSpec.describe TicketLevel, type: :model do
|
||||||
|
|
||||||
it 'announces create' do
|
it 'announces create' do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_created, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_created, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'ticket_level.created',
|
'type' => 'ticket_level.created',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -85,7 +85,7 @@ RSpec.describe TicketLevel, type: :model do
|
||||||
|
|
||||||
it 'announces create' do
|
it 'announces create' do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_created, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_created, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'ticket_level.created',
|
'type' => 'ticket_level.created',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -131,7 +131,7 @@ RSpec.describe TicketLevel, type: :model do
|
||||||
it 'announces updated' do
|
it 'announces updated' do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_created, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_updated, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_updated, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'ticket_level.updated',
|
'type' => 'ticket_level.updated',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -177,7 +177,7 @@ RSpec.describe TicketLevel, type: :model do
|
||||||
it 'announces updated' do
|
it 'announces updated' do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_created, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_updated, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_updated, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'ticket_level.updated',
|
'type' => 'ticket_level.updated',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -226,7 +226,7 @@ RSpec.describe TicketLevel, type: :model do
|
||||||
it 'announces deleted' do
|
it 'announces deleted' do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_created, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_deleted, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_deleted, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'ticket_level.deleted',
|
'type' => 'ticket_level.deleted',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
@ -268,7 +268,7 @@ RSpec.describe TicketLevel, type: :model do
|
||||||
it 'announces deleted' do
|
it 'announces deleted' do
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_created, anything).ordered
|
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_created, anything).ordered
|
||||||
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_deleted, {
|
expect(Houdini.event_publisher).to receive(:announce).with(:ticket_level_deleted, {
|
||||||
'id' => kind_of(String),
|
'id' => match(/objevt_[a-zA-Z0-9]{22}/),
|
||||||
'object' => 'object_event',
|
'object' => 'object_event',
|
||||||
'type' => 'ticket_level.deleted',
|
'type' => 'ticket_level.deleted',
|
||||||
'data' => {
|
'data' => {
|
||||||
|
|
Loading…
Reference in a new issue