Ver a proveniência

add check to ensure each user received exactly one first_payment notification

tags/v0.15.7
Jonathan Cobb há 4 anos
ascendente
cometimento
328d33d280
2 ficheiros alterados com 81 adições e 7 eliminações
  1. +26
    -0
      bubble-server/src/test/resources/models/include/confirm_first_payment_notification.json
  2. +55
    -7
      bubble-server/src/test/resources/models/tests/promo/multi_promo.json

+ 26
- 0
bubble-server/src/test/resources/models/include/confirm_first_payment_notification.json Ver ficheiro

@@ -0,0 +1,26 @@
[
{
"comment": "declare default parameters for new_account test part",
"include": "_defaults",
"params": {
"email": "_required",
"rootSessionName": "rootSession",
"expectedCount": "1"
}
},
{
"comment": "root: confirm <<email>> received exactly one first_payment notification",
"request": {
"session": "rootSession",
"uri": "debug/inbox/email/<<email>>?type=notice&action=first_payment&target=network"
},
"response": {
"check": [
{"condition": "json.length === <<expectedCount>>"},
{"condition": "'{{json.[0].ctx.message.messageType}}' === 'notice'"},
{"condition": "'{{json.[0].ctx.message.action}}' === 'first_payment'"},
{"condition": "'{{json.[0].ctx.message.target}}' === 'network'"}
]
}
}
]

+ 55
- 7
bubble-server/src/test/resources/models/tests/promo/multi_promo.json Ver ficheiro

@@ -308,7 +308,7 @@

// Second Month -- referred users use their referral credit. referring user pays with card
{
"before": "fast_forward_and_bill 29d 60s",
"before": "fast_forward_and_bill 29d 40s",
"comment": "root: fast-forward +29 days, verify referring user received notice about first real payment",
"request": {
"session": "rootSession",
@@ -350,7 +350,7 @@
},

{
"before": "fast_forward_and_bill 2d 30s",
"before": "fast_forward_and_bill 2d 40s",
"comment": "referring: fast-forward +2 days, verify a new bill exists for referring",
"request": {
"session": "referringUserSession",
@@ -438,8 +438,34 @@

// Third Month -- referred users pay with card. referring user pays with 1st referral credit
{
"before": "fast_forward_and_bill 31d 30s",
"comment": "referring: second fast-forward +31 days, verify a new bill exists for referring",
"before": "fast_forward_and_bill 29d 40s",
"comment": "root: second fast-forward +29 days, verify referred user 1 received notice about first real payment",
"request": {
"session": "rootSession",
"uri": "debug/inbox/email/referred_multi_1@example.com?type=notice&action=first_payment&target=network"
},
"response": {
"check": [
{"condition": "'{{json.[0].ctx.message.messageType}}' === 'notice'"},
{"condition": "'{{json.[0].ctx.message.action}}' === 'first_payment'"},
{"condition": "'{{json.[0].ctx.message.target}}' === 'network'"}
]
}
},
{
"comment": "root: verify referred user 2 received notice about first real payment",
"include": "confirm_first_payment_notification",
"params": { "email": "referred_multi_2@example.com" }
},
{
"comment": "root: verify referred user 3 received notice about first real payment",
"include": "confirm_first_payment_notification",
"params": { "email": "referred_multi_3@example.com" }
},

{
"before": "fast_forward_and_bill 2d 40s",
"comment": "referring: second fast-forward +2 days, verify a new bill exists for referring",
"request": {
"session": "referringUserSession",
"uri": "me/plans/{{referringAccountPlan.uuid}}/bills"
@@ -541,7 +567,7 @@

// Fourth Month -- referreds pay with card, referring pays with 2nd referral credit
{
"before": "fast_forward_and_bill 31d 30s",
"before": "fast_forward_and_bill 31d 40s",
"comment": "referring: third fast-forward +31 days, verify a new bill exists for referring",
"request": {
"session": "referringUserSession",
@@ -717,7 +743,7 @@

// 6th Month -- referreds pay with card, referring uses regular account credit + card
{
"before": "fast_forward_and_bill 31d 30s",
"before": "fast_forward_and_bill 31d 40s",
"comment": "referring: fifth fast-forward +31 days, verify a new bill exists for referring",
"request": {
"session": "referringUserSession",
@@ -809,7 +835,7 @@

// 7th Month -- everyone pays with credit card
{
"before": "fast_forward_and_bill 31d 30s",
"before": "fast_forward_and_bill 31d 40s",
"comment": "referring: sixth fast-forward +31 days, verify a new bill exists for referring",
"request": {
"session": "referringUserSession",
@@ -958,5 +984,27 @@
{"condition": "_find(json, function(p) { return p.getMaskedPaymentInfo() === 'AccountCredit5' && p.deleted(); }) !== null"}
]
}
},

// confirm each user has received exactly one first_payment notification
{
"comment": "root: confirm referring user received exactly one first_payment notification",
"include": "confirm_first_payment_notification",
"params": { "email": "test_user_referring_multi@example.com" }
},
{
"comment": "root: confirm referring user received exactly one first_payment notification",
"include": "confirm_first_payment_notification",
"params": { "email": "referred_multi_1@example.com" }
},
{
"comment": "root: confirm referring user received exactly one first_payment notification",
"include": "confirm_first_payment_notification",
"params": { "email": "referred_multi_2@example.com" }
},
{
"comment": "root: confirm referring user received exactly one first_payment notification",
"include": "confirm_first_payment_notification",
"params": { "email": "referred_multi_3@example.com" }
}
]

Carregando…
Cancelar
Guardar