diff --git a/spec/javascripts/unit/darkswarm/controllers/products_controller_spec.js.coffee b/spec/javascripts/unit/darkswarm/controllers/products_controller_spec.js.coffee index 3a7dd8ba1b..858415847d 100644 --- a/spec/javascripts/unit/darkswarm/controllers/products_controller_spec.js.coffee +++ b/spec/javascripts/unit/darkswarm/controllers/products_controller_spec.js.coffee @@ -6,6 +6,7 @@ describe 'ProductsCtrl', -> Cart = {} Taxons = null Properties = null + currentHub = null beforeEach -> module('Darkswarm') @@ -19,10 +20,12 @@ describe 'ProductsCtrl', -> Taxons: taxons: [] Properties: {} + currentHub = + id: 1 inject ($rootScope, $controller) -> scope = $rootScope - ctrl = $controller 'ProductsCtrl', {$scope: scope, Products: Products, OrderCycle: OrderCycle, Cart: Cart, Taxons: Taxons, Properties: Properties} + ctrl = $controller 'ProductsCtrl', {$scope: scope, Products: Products, OrderCycle: OrderCycle, Cart: Cart, Taxons: Taxons, Properties: Properties, currentHub: currentHub} it 'fetches products from Products', -> expect(scope.Products.products).toEqual ['testy mctest'] diff --git a/spec/javascripts/unit/darkswarm/services/checkout_spec.js.coffee b/spec/javascripts/unit/darkswarm/services/checkout_spec.js.coffee index 8c5d49633b..0336c4ffe3 100644 --- a/spec/javascripts/unit/darkswarm/services/checkout_spec.js.coffee +++ b/spec/javascripts/unit/darkswarm/services/checkout_spec.js.coffee @@ -3,6 +3,7 @@ describe 'Checkout service', -> notify: (arg) -> Checkout = null orderData = null + currentHub = null $httpBackend = null Navigation = null navigationSpy = null @@ -49,6 +50,9 @@ describe 'Checkout service', -> lastname: "Harrington" ship_address: {test: "bar"} user_id: 901 + currentHub = + hub: + id: 99 window.Bugsnag = BugsnagMock @@ -58,6 +62,7 @@ describe 'Checkout service', -> $provide.value "Loading", Loading $provide.value "currentOrder", orderData $provide.value "shippingMethods", shippingMethods + $provide.value "currentHub", currentHub $provide.value "paymentMethods", paymentMethods $provide.value "StripeInstancePublishableKey", "instance_publishable_key" null diff --git a/spec/javascripts/unit/darkswarm/services/products_spec.js.coffee b/spec/javascripts/unit/darkswarm/services/products_spec.js.coffee index df6446b433..4c35fb80dd 100644 --- a/spec/javascripts/unit/darkswarm/services/products_spec.js.coffee +++ b/spec/javascripts/unit/darkswarm/services/products_spec.js.coffee @@ -8,6 +8,7 @@ describe 'Products service', -> Cart = null shopfront = null currentOrder = null + currentHub = null product = null productWithImage = null properties = null @@ -33,6 +34,8 @@ describe 'Products service', -> ] currentOrder = line_items: [] + currentHub = + id: 1 properties = { id: 1, name: "some property" } taxons = @@ -51,6 +54,7 @@ describe 'Products service', -> module ($provide)-> $provide.value "shopfront", shopfront $provide.value "currentOrder", currentOrder + $provide.value "currentHub", currentHub $provide.value "taxons", taxons $provide.value "properties", properties $provide.value "GmapsGeo", GmapsGeo