1
0
mirror of synced 2026-08-05 14:47:03 +00:00

Create Plans

* rescue and respond to error from stripe
* save plan name and id
This commit is contained in:
Rimian Perkins
2019-10-08 15:55:38 +11:00
parent 99abd87c73
commit 6f9195a7d4
4 changed files with 35 additions and 11 deletions
+10
View File
@@ -35,6 +35,16 @@ module DiscoursePatrons
::Stripe::Plan.expects(:create).with(has_entry(:amount, '102'))
post "/patrons/admin/plans.json", params: { amount: '102' }
end
it "creates a plan with a title" do
::Stripe::Plan.expects(:create).with(has_entry(:product, name: 'Rick Astley'))
post "/patrons/admin/plans.json", params: { name: 'Rick Astley' }
end
it "creates a plan with an id" do
::Stripe::Plan.expects(:create).with(has_entry(id: 'rick-astley'))
post "/patrons/admin/plans.json", params: { name: 'Rick Astley' }
end
end
describe "delete" do