Add js specs for providers controller

This commit is contained in:
Rob H
2014-07-23 15:17:03 +10:00
parent 9e54162a62
commit 6b73eb435c

View File

@@ -0,0 +1,30 @@
describe "ProvidersCtrl", ->
ctrl = null
scope = null
paymentMethod = null
describe "initialising using a payment method without a type", ->
beforeEach ->
module 'ofn.admin'
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 'ofn.admin'
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};"