spec the plans
This commit is contained in:
parent
a2d120c8b5
commit
bfdc8a5691
|
@ -13,7 +13,7 @@ module DiscoursePatrons
|
|||
product: {
|
||||
name: 'Gold special',
|
||||
},
|
||||
currency: 'usd',
|
||||
currency: SiteSetting.discourse_patrons_currency,
|
||||
id: 'gold-special',
|
||||
)
|
||||
|
||||
|
|
|
@ -12,9 +12,20 @@ module DiscoursePatrons
|
|||
expect(DiscoursePatrons::PlansController < Admin::AdminController).to eq(true)
|
||||
end
|
||||
|
||||
it "creates a plan" do
|
||||
::Stripe::Plan.expects(:create)
|
||||
it "creates a plan with a currency" do
|
||||
SiteSetting.stubs(:discourse_patrons_currency).returns('aud')
|
||||
::Stripe::Plan.expects(:create).with(has_entry(:currency, 'aud'))
|
||||
post "/patrons/admin/plans.json", params: {}
|
||||
end
|
||||
|
||||
it "creates a plan with an interval" do
|
||||
::Stripe::Plan.expects(:create).with(has_entry(:interval, 'week'))
|
||||
post "/patrons/admin/plans.json", params: { interval: 'week' }
|
||||
end
|
||||
|
||||
it "creates a plan with an amount" do
|
||||
::Stripe::Plan.expects(:create).with(has_entry(:amount, '102'))
|
||||
post "/patrons/admin/plans.json", params: { amount: '102' }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue