Switching Checkout service to use CurrentOrder

This commit is contained in:
Will Marshall
2014-07-17 14:26:54 +10:00
parent 158bdd145f
commit 541fe9ec37
3 changed files with 4 additions and 3 deletions

View File

@@ -1,8 +1,8 @@
Darkswarm.factory 'Checkout', (Order, ShippingMethods, PaymentMethods, $http, Navigation, CurrentHub, RailsFlashLoader, Loading)->
Darkswarm.factory 'Checkout', (CurrentOrder, ShippingMethods, PaymentMethods, $http, Navigation, CurrentHub, RailsFlashLoader, Loading)->
new class Checkout
errors: {}
secrets: {}
order: Order.order
order: CurrentOrder.order
ship_address_same_as_billing: true
submit: ->

View File

@@ -24,6 +24,7 @@
%i.ofn-i_005-caret-down
-# TODO render this in Angular instead of server-side
-# The problem being how to render the partials
- current_order.available_payment_methods.each do |method|
.row
.small-12.columns

View File

@@ -39,10 +39,10 @@ describe 'Checkout service', ->
ship_address: {test: "bar"}
user_id: 901
angular.module('Darkswarm').value('order', orderData)
module 'Darkswarm'
module ($provide)->
$provide.value "RailsFlashLoader", FlashLoaderMock
$provide.value "currentOrder", orderData
$provide.value "shippingMethods", shippingMethods
$provide.value "paymentMethods", paymentMethods
null