|
70 | 70 | expect(data[event_b.id][:id]).to eq(event_b.id)
|
71 | 71 | end
|
72 | 72 |
|
| 73 | + it "handles stripe connect event when user_id is present" do |
| 74 | + acc_12314 = 'acc_12314' |
| 75 | + event = StripeMock.mock_webhook_event('customer.created', user_id: acc_12314) |
| 76 | + expect(event[:user_id]).to eq(acc_12314) |
| 77 | + end |
| 78 | + |
73 | 79 | it "retrieves an eveng using the event resource" do
|
74 | 80 | webhook_event = StripeMock.mock_webhook_event('plan.created')
|
75 | 81 | expect(webhook_event.id).to_not be_nil
|
|
145 | 151 | invoice_item_created_event = StripeMock.mock_webhook_event('invoiceitem.created')
|
146 | 152 | expect(invoice_item_created_event).to be_a(Stripe::Event)
|
147 | 153 | expect(invoice_item_created_event).to_not be_nil
|
148 |
| - |
| 154 | + |
149 | 155 | events = Stripe::Event.all
|
150 |
| - |
| 156 | + |
151 | 157 | expect(events.count).to eq(5)
|
152 | 158 | expect(events.map &:id).to include(customer_created_event.id, plan_created_event.id, coupon_created_event.id, invoice_created_event.id, invoice_item_created_event.id)
|
153 | 159 | expect(events.map &:type).to include('customer.created', 'plan.created', 'coupon.created', 'invoice.created', 'invoiceitem.created')
|
|
173 | 179 | invoice_item_created_event = StripeMock.mock_webhook_event('invoiceitem.created')
|
174 | 180 | expect(invoice_item_created_event).to be_a(Stripe::Event)
|
175 | 181 | expect(invoice_item_created_event).to_not be_nil
|
176 |
| - |
| 182 | + |
177 | 183 | events = Stripe::Event.all(limit: 3)
|
178 |
| - |
| 184 | + |
179 | 185 | expect(events.count).to eq(3)
|
180 | 186 | expect(events.map &:id).to include(customer_created_event.id, plan_created_event.id, coupon_created_event.id)
|
181 | 187 | expect(events.map &:type).to include('customer.created', 'plan.created', 'coupon.created')
|
182 |
| - end |
| 188 | + end |
183 | 189 |
|
184 | 190 | end
|
185 | 191 |
|
|
0 commit comments