mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Fix bug in subscriptions address controller where the country id lookup was not exact and states returned were incorrect. Add unit tests to cover different cases
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
describe "ProvidersCtrl", ->
|
||||
ctrl = null
|
||||
scope = null
|
||||
paymentMethod = null
|
||||
|
||||
describe "initialising using a payment method without a type", ->
|
||||
beforeEach ->
|
||||
module 'admin.paymentMethods'
|
||||
scope = {}
|
||||
paymentMethod =
|
||||
type: null
|
||||
|
||||
inject ($controller)->
|
||||
ctrl = $controller 'ProvidersCtrl', {$scope: scope, paymentMethod: paymentMethod }
|
||||
|
||||
it "sets the invlude_html porperty on scope to blank", ->
|
||||
expect(scope.include_html).toBe ""
|
||||
|
||||
describe "initialising using a payment method with a type", ->
|
||||
beforeEach ->
|
||||
module 'admin.paymentMethods'
|
||||
scope = {}
|
||||
paymentMethod =
|
||||
type: "NOT NULL"
|
||||
|
||||
inject ($controller)->
|
||||
ctrl = $controller 'ProvidersCtrl', {$scope: scope, paymentMethod: paymentMethod }
|
||||
|
||||
it "sets the include_html porperty on scope to some address", ->
|
||||
expect(scope.include_html).toBe "/admin/payment_methods/show_provider_preferences?provider_type=NOT NULL;pm_id=#{paymentMethod.id};"
|
||||
Reference in New Issue
Block a user