zinc-collective / compensated

Create value. Get Paid.
Other
13 stars 1 forks source link

Add more full support for canceled/ended #61

Closed zspencer closed 4 years ago

zspencer commented 4 years ago

While working with @etlund, we discovered that we do not currently handle when a stripe event comes in withended_at or cancelled_at values.

We began to restructure the subscription data structure to include the subscription period and status.

However as we were testing, we wanted to add a permutation test for when the canceled_at was set but ended_at wasn't, which prompted a desire to interpolate data in our specs so we don't have to copy-paste the fixtures over and over.

We think that using ERB for now makes sense, since it's built into Ruby.

We also wound up doing a pretty major restructuring of the expectations in the rspec code so we could make smaller assertions for focused parts of the resulting data structure.