Merge branch 'laura_and_will'

This commit is contained in:
Rohan Mitchell
2014-08-07 16:50:00 +10:00
40 changed files with 201 additions and 101 deletions

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="32px" y="32px" height="32px" width="32px"
viewBox="0 0 30.2 40" enable-background="new 0 0 30.2 40" xml:space="preserve">
<g id="Layer_1_1_">
<g>

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="32px" y="32px" height="32px" width="32px"
viewBox="0 0 30.2 40" enable-background="new 0 0 30.2 40" xml:space="preserve">
<g id="Layer_1_1_">
<g>

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="32px" y="32px" height="32px" width="32px"
viewBox="0 0 30.2 40" enable-background="new 0 0 30.2 40" xml:space="preserve">
<g id="Layer_1_1_">
<g>

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -4,5 +4,6 @@ Darkswarm.factory "ShippingMethods", (shippingMethods)->
shipping_methods_by_id: {}
constructor: ->
for method in @shipping_methods
method.price = parseFloat(method.price)
@shipping_methods_by_id[method.id] = method

View File

@@ -4,11 +4,11 @@
%p{"ng-if" => "enterprise.phone"}
{{ enterprise.phone }}
%p{"ng-if" => "enterprise.email"}
%p.word-wrap{"ng-if" => "enterprise.email"}
%a{"ng-href" => "{{enterprise.email | stripUrl}}", target: "_blank", mailto: true}
%span.email
{{ enterprise.email | stripUrl }}
%p{"ng-if" => "enterprise.website"}
%p.word-wrap{"ng-if" => "enterprise.website"}
%a{"ng-href" => "http://{{enterprise.website | stripUrl}}", target: "_blank" }
{{ enterprise.website | stripUrl }}

View File

@@ -1,7 +1,7 @@
.highlight
.highlight-top
%p.right
{{ [enterprise.address.city, enterprise.address.state] | printArray}}
{{ [enterprise.address.city, enterprise.address.state_name] | printArray}}
%h3{"ng-if" => "enterprise.is_distributor"}
%a{"bo-href" => "enterprise.path", "ofn-empties-cart" => "enterprise", bindonce: true}
%i.ofn-i_040-hub

View File

@@ -11,6 +11,6 @@
%i.ofn-i_033-open-sign{"bo-if" => "hub.active"}
%i.ofn-i_032-closed-sign{"bo-if" => "!hub.active"}
{{hub.name}}
.button-address {{ hub.address.city }} , {{hub.address.state}}
.button-address {{ hub.address.city }} , {{hub.address.state_name}}
%i.ofn-i_007-caret-right

View File

@@ -1,10 +1,10 @@
.row.pad-top{bindonce: true}
.cta-container.small-12.columns
.row
.small-12.large-6.columns
%label{"active-table-hub-link" => "enterprise", change: "Change hub to", shop: "Shop now at"}
.small-12.large-6.columns.right
.right{"bo-if" => "enterprise.pickup || enterprise.delivery"}
.small-4.columns
%label{"active-table-hub-link" => "enterprise", change: "Change hub to:", shop: "Shop now at:"}
.small-8.columns.right
%label.right{"bo-if" => "enterprise.pickup || enterprise.delivery"}
Delivery options:
%span{"bo-if" => "enterprise.pickup"}
%i.ofn-i_038-takeaway
@@ -20,5 +20,5 @@
%i.ofn-i_033-open-sign{"bo-if" => "enterprise.active"}
%i.ofn-i_032-closed-sign{"bo-if" => "!enterprise.active"}
{{enterprise.name}}
.button-address {{ enterprise.address.city }} , {{enterprise.address.state}}
.button-address {{ enterprise.address.city }} , {{enterprise.address.state_name}}
%i.ofn-i_007-caret-right

View File

@@ -1,4 +1,4 @@
.joyride-tip-guide{bindonce: true, "ng-class" => "{ in: tt_isOpen, fade: tt_animation }"}
.joyride-tip-guide.price_breakdown{bindonce: true, "ng-class" => "{ in: tt_isOpen, fade: tt_animation }"}
%span.joyride-nub.right
.joyride-content-wrapper
.collapsed{"ng-show" => "!expanded"}
@@ -11,7 +11,7 @@
%ul
%li.cost
.right {{ variant.base_price | currency }}
Cost
Item cost
%li{"bo-if" => "variant.fees.admin"}
.right {{ variant.fees.admin | currency }}
Admin fee

View File

@@ -1,5 +1,5 @@
.progress
.right Fees
.meter
Cost
Item cost

View File

@@ -1,15 +1,28 @@
@import mixins
@import branding
// .darkswarm
// product
ordercycle
.joyride-tip-guide
background-color: $clr-brick
.joyride-nub.right
border-color: $clr-brick !important
border-top-color: transparent !important
border-right-color: transparent !important
border-bottom-color: transparent !important
p
margin: 0
font-weight: 700
// Pop over
// Foundation overrides
.joyride-tip-guide
.joyride-tip-guide.price_breakdown
// JS needs to be tweaked to adjust for left alignment - this is dynamic can't rewrite in CSS
background-color: #999
color: #1f1f1f
margin-left: -8px
@include box-shadow(0 1px 2px 0 rgba(0,0,0,0.7))
.joyride-content-wrapper
@@ -23,7 +36,7 @@
color: #1f1f1f
.joyride-nub.right
top: 40px
top: 38px
border-color: #999 !important
border-top-color: transparent !important
border-right-color: transparent !important
@@ -62,19 +75,17 @@
button.graph-button
z-index: 9999999
border: 1px solid transparent
@include box-shadow(none)
padding: 0
margin: 0
@include border-radius(99999)
@include border-radius(999rem)
display: inline
background-color: rgba(255,255,255,0.5)
padding: 0.2rem
padding: 5px
&:focus
background-color: rgba(255,255,255,0.5)
i.ofn-i-058-graph
color: #999
&:hover, &:active
&:hover, &:active, &:focus
background-color: rgba(255,255,255,1)
i.ofn-i-058-graph
color: $clr-brick-bright
@@ -86,10 +97,11 @@ button.graph-button
font-size: 1rem
button.graph-button.open
background-color: #999
@include box-shadow(inset 0 1px 1px 0 rgba(0,0,0,0.35))
border: 1px solid #999
&:hover, &:active, &:focus
background-color: #b2b2b2
background-color: rgba(255,255,255,1)
i.ofn-i-058-graph
color: $clr-brick-bright

View File

@@ -1,3 +1,5 @@
@import branding.css.sass
.darkswarm
products
product
@@ -25,9 +27,13 @@
.row.variants
margin-left: 0
margin-right: 0
background: url("/assets/gray_jean.png") top left repeat
background-color: #ECECEC
&:hover, &:focus, &:active
background-color: $clr-brick-light
&:nth-of-type(even)
background: url("/assets/gray_jean_light.png") top left repeat
background-color: #f9f9f9
&:hover, &:focus, &:active
background-color: $clr-brick-ultra-light
// Variant name
.variant-name
@@ -72,7 +78,6 @@
.table-cell
height: 27px
// ROW SUMMARY
.row.summary
margin-left: 0
@@ -108,7 +113,3 @@

View File

@@ -8,12 +8,13 @@
// $clr-turquoise: #097563
// $clr-turquoise-light: #cef2ec
// $clr-turquoise-ultra-light: #e6faf7
// $clr-turquoise-bright: #1d8f7c
// $clr-turquoise-bright: #1d8f7c
$clr-brick: #c1122b
$clr-brick-light: #f5e6e7
$clr-brick-ultra-light: #faf5f6
$clr-brick-bright: #eb4c46
$clr-brick-med-bright: #e5a2a0
$clr-brick-light-bright: #f5c4c9
$clr-turquoise: #0b8c61

View File

@@ -12,7 +12,7 @@
//Hub icon styline
i.ofn-i_040-hub
@include border-radius(9999em)
@include border-radius(99999rem)
font-size: 1.15rem
display: inline-block
padding: 0.2rem

View File

@@ -8,6 +8,7 @@
map, .angular-google-map-container, google-map, .angular-google-map
display: block
height: 100%
width: 100%
img // https://github.com/zurb/foundation/issues/112
max-width: none

View File

@@ -60,19 +60,26 @@
// CALL TO ACTION - hub click throughs
.cta-container
background: url("/assets/gray_jean.png") repeat
background-color: #ececec
padding-top: 0.75rem
label
text-transform: uppercase
font-size: 0.875rem
margin-bottom: 0.5rem
margin-bottom: 0
5rem
color: $dark-grey
label.right
color: $disabled-dark
span
text-transform: capitalize
.button.secondary
background-color: #999
.button.hub
margin-right: 1rem
margin-top: 0.25rem
margin-bottom: 1rem
padding-left: 1rem
padding-right: 1rem
@@ -114,4 +121,4 @@
border-bottom: 1px solid $disabled-dark
margin-top: 0.75rem
margin-bottom: 0.5rem

View File

@@ -4,29 +4,38 @@
dialog, .reveal-modal
border: none
outline: none
padding: 1rem
// TO DO: look at bigger issue scrolling on mobile device
padding: 1rem
overflow-y: scroll
@media only screen and (min-width: 40.063em)
max-height: 580px
@media all and (max-width: 768px)
max-height: 440px
@media all and (max-width: 640px)
max-height: 400px
@media all and (max-width: 640px)
max-height: inherit
// Sets up max heights based on device height
@media all and (min-height: 1025px)
max-height: 80%
@media all and (min-height: 700px) and (max-height: 1024px)
max-height: 70%
@media all and (min-height: 600px) and (max-height: 699px)
max-height: 60%
@media all and (min-height: 481px) and (max-height: 599px)
max-height: 60%
@media only screen and (max-height: 480px) and (min-width: 641px)
max-height: 60%
@media all and (max-height: 480px)
overflow-y: scroll
.reveal-modal-bg
background-color: rgba(0,0,0,0.65)
dialog .close-reveal-modal, .reveal-modal .close-reveal-modal
top: 0.45rem
right: 0.4rem
background-color: rgba(235,235,235,0.85)
text-shadow: none
padding: 0.3rem
@include border-radius(999999)
@include border-radius(999999rem)
&:hover, &:active, &:focus
background-color: rgba(235,235,235,1)
color: #333

View File

@@ -30,6 +30,7 @@
product
@include csstrans
border-bottom: 1px solid #e5e5e5
border-top: 1px solid #e5e5e5
padding-bottom: 1px
@@ -38,6 +39,10 @@
display: block
color: #444
&:hover, &:focus, &:active
border-bottom: 1px solid $clr-brick-med-bright
border-top: 1px solid $clr-brick-med-bright
// BULK
.bulk-buy
font-size: 0.875rem

View File

@@ -12,7 +12,7 @@
display: block
right: 10px
top: 55px
width: 400px
width: 480px
@media screen and (max-width: 640px)
width: 96%

View File

@@ -34,6 +34,10 @@ small, .small
margin-bottom: 0.5rem
&, & *
font-size: 0.875rem
.word-wrap
word-wrap: break-word
.light
color: #999
display: inline

View File

@@ -58,10 +58,10 @@
text-shadow: 0 1px 0 $clr-brick
button.success, .button.success
background: $clr-turquoise
background: #0096ad
.button.success:hover, .button.success:active, .button.success:focus, button.success:hover, button.success:active, button.success:focus
background: $clr-turquoise-bright
background: #14b6cc
// Responsive
@media screen and (min-width: 768px)

View File

@@ -1,18 +1,31 @@
module CheckoutHelper
def checkout_adjustments_for_summary(order, opts={})
adjustments = order.adjustments.eligible
exclude = opts[:exclude] || {}
# Remove empty tax adjustments and (optionally) shipping fees
adjustments.reject! { |a| a.originator_type == 'Spree::TaxRate' && a.amount == 0 }
adjustments.reject! { |a| a.originator_type == 'Spree::ShippingMethod' } if opts[:exclude_shipping]
adjustments.reject! { |a| a.originator_type == 'Spree::ShippingMethod' } if exclude.include? :shipping
enterprise_fee_adjustments = adjustments.select { |a| a.originator_type == 'EnterpriseFee' }
adjustments.reject! { |a| a.originator_type == 'EnterpriseFee' }
adjustments << Spree::Adjustment.new(label: 'Distribution', amount: enterprise_fee_adjustments.sum(&:amount))
unless exclude.include? :distribution
adjustments << Spree::Adjustment.new(label: 'Distribution', amount: enterprise_fee_adjustments.sum(&:amount))
end
adjustments
end
def checkout_adjustments_total(order)
adjustments = checkout_adjustments_for_summary(order, exclude: [:shipping])
adjustments.sum &:display_amount
end
def checkout_cart_total_with_adjustments(order)
current_order.display_item_total.money.to_f + checkout_adjustments_total(current_order).money.to_f
end
def validated_input(name, path, args = {})
attributes = {
required: true,

View File

@@ -10,4 +10,8 @@ class Api::CurrentOrderSerializer < ActiveModel::Serializer
def payment_method_id
object.payments.first.andand.payment_method_id
end
def display_total
object.display_total.money.to_f
end
end

View File

@@ -10,9 +10,9 @@
angular.module('Darkswarm').value('order', #{render "checkout/order"})
%div
%h3.text-center.pad-top
Checkout from
= current_distributor.name
/ %h3.text-center.pad-top
/ Checkout from
/ = current_distributor.name
= render partial: "checkout/details", locals: {f: f}
= render partial: "checkout/billing", locals: {f: f}

View File

@@ -1,22 +1,24 @@
%orderdetails
= form_for current_order, url: "#", html: {"ng-submit" => "purchase($event)"} do |f|
%fieldset
%legend Your Order
%legend Your order
%table
%tr
%th Produce
%td= current_order.display_item_total
%th Cart total
%td.cart-total.text-right= number_to_currency checkout_cart_total_with_adjustments(current_order)
- checkout_adjustments_for_summary(current_order, exclude_shipping: true).each do |adjustment|
- checkout_adjustments_for_summary(current_order, exclude: [:shipping, :distribution]).each do |adjustment|
%tr
%th= adjustment.label
%td= adjustment.display_amount.to_html
%td.text-right= adjustment.display_amount.to_html
%tr
%th Shipping
%td {{ Checkout.shippingPrice() | currency }}
%td.shipping.text-right {{ Checkout.shippingPrice() | currency }}
%tr
%th Cart total
%td {{ Checkout.cartTotal() | currency }}
%th Total
%td.total.text-right {{ Checkout.cartTotal() | currency }}
- if current_order.price_adjustment_totals.present?
- current_order.price_adjustment_totals.each do |label, total|
%tr

View File

@@ -2,9 +2,12 @@
.darkswarm
- content_for :order_cycle_form do
%strong.avenir
%closing Checkout now
%p
Order ready for
= pickup_time current_order_cycle
%strong
= pickup_time current_order_cycle
= render partial: "shopping_shared/details"

View File

@@ -43,7 +43,7 @@
%a{href:"https://creativecommons.org/licenses/by-sa/3.0/", target: "_blank" } Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
%p
%small
%a{href:'' } Site terms & conditions
%a{href:"/Terms-of-service.pdf", target: "_blank" } Site terms & conditions
|
%a{href:"https://github.com/openfoodfoundation/openfoodnetwork", target: "_blank" } Open Source & developer info on Github

View File

@@ -14,20 +14,21 @@
%li.product-cart{"ng-repeat" => "line_item in Cart.line_items_present()",
"ng-controller" => "LineItemCtrl"}
.row
.columns.small-6
.columns.small-7
%small
%strong {{ line_item.variant.name_to_display }}
%em {{ line_item.variant.unit_to_display }}
.columns.small-3
%small
{{line_item.quantity}}
x
{{ line_item.variant.price | currency }}
.columns.small-3.text-right
%small
{{line_item.quantity}}
%i.ofn-i_009-close
{{ line_item.variant.price | currency }}
.columns.small-2
%small
\=
%strong {{ line_item.variant.getPrice() | currency }}
%strong
.right {{ line_item.variant.getPrice() | currency }}
%li.total-cart{"ng-show" => "Cart.line_items_present().length > 0"}
.row
@@ -36,5 +37,5 @@
.columns.small-6.text-right
%strong {{ Cart.total() | currency }}
.text-right
%a.button.primary.small{href: checkout_path, "ng-disabled" => "Cart.dirty"} Checkout now
.text-right
%a.button.primary.small{href: checkout_path, "ng-disabled" => "Cart.dirty"} Quick checkout

View File

@@ -12,7 +12,7 @@
%form{action: cart_path}
.small-12.medium-4.large-3.columns
%input.button.primary.right.add_to_cart{type: :submit, value: "Checkout now",
%input.button.primary.right.add_to_cart{type: :submit, value: "Your shopping cart",
"ng-disabled" => "Cart.dirty"}
%div.pad-top{bindonce: true}
@@ -38,6 +38,6 @@
.row
.small-12.columns
%form{action: cart_path}
%input.button.primary.right.add_to_cart{type: :submit, value: "Checkout now",
%input.button.primary.right.add_to_cart{type: :submit, value: "Your shopping cart",
"ng-disabled" => "Cart.dirty"}

View File

@@ -15,7 +15,7 @@
%select.avenir#order_cycle_id{"ng-model" => "order_cycle.order_cycle_id",
"ng-change" => "changeOrderCycle()",
"ng-options" => "oc.id as oc.time for oc in #{@order_cycles.map {|oc| {time: pickup_time(oc), id: oc.id}}.to_json}",
"popover-placement" => "bottom", "popover" => "When do you want to get your order?", "popover-trigger" => "openTrigger"}
"popover-placement" => "left", "popover" => "Choose when you want your order:", "popover-trigger" => "openTrigger"}

View File

@@ -1,7 +1,7 @@
%td{'data-hook' => "cart_item_description"}
%h4= link_to variant.product.name, product_path(variant.product)
%h4= variant.product.name
= variant.options_text
- if @order.insufficient_stock_lines.include? line_item
%span.out-of-stock
= variant.in_stock? ? t(:insufficient_stock, :on_hand => variant.on_hand) : t(:out_of_stock)
%br/
%br/

View File

@@ -2,12 +2,14 @@
.darkswarm
- content_for :order_cycle_form do
%strong.avenir
Order ready on
- if @order.order_cycle
= pickup_time @order.order_cycle
- else
= @order.distributor.next_collection_at
%closing Your shopping cart
%p
Order ready for
%strong
- if @order.order_cycle
= pickup_time @order.order_cycle
- else
= @order.distributor.next_collection_at
= render partial: "shopping_shared/details"

View File

@@ -28,7 +28,7 @@
<body>
<!-- This file lives in public/404.html -->
<div class="dialog">
<a href="/" ><img src="404.jpg" /></a>
<a href="/" ><img src="/404.jpg" /></a>
<p>It seems the page you're looking for is in a grump.
<br><h3><a class="go_home" href="/" >Return home</a></h3>
</p>

View File

@@ -28,7 +28,7 @@
<body>
<!-- This file lives in public/422.html -->
<div class="dialog">
<a href="/" ><img src="422.jpg" /></a>
<a href="/" ><img src="/422.jpg" /></a>
<p>The change you wanted was rejected. Maybe you tried to change something you don't have access to.
<br><h3><a class="go_home" href="/" >Return home</a></h3>
</p>

View File

@@ -28,7 +28,7 @@
<body>
<!-- This file lives in public/500.html -->
<div class="dialog">
<a href="/" ><img src="500.jpg" /></a>
<a href="/" ><img src="/500.jpg" /></a>
<p>We're sorry, but something went wrong.
<br>Try refreshing the page, or
<br><h3><a class="go_home" href="/" >Return home</a></h3>

BIN
public/Terms-of-service.pdf Normal file

Binary file not shown.

View File

@@ -17,5 +17,6 @@ feature 'Groups', js: true do
page.should have_content enterprise.name
open_enterprise_modal enterprise
modal_should_be_open_for enterprise
page.should have_content "Herndon, Vic"
end
end

View File

@@ -10,27 +10,29 @@ feature "As a consumer I want to check out my cart", js: true do
let(:distributor) { create(:distributor_enterprise) }
let(:supplier) { create(:supplier_enterprise) }
let!(:order_cycle) { create(:simple_order_cycle, distributors: [distributor], coordinator: create(:distributor_enterprise)) }
let!(:order_cycle) { create(:simple_order_cycle, suppliers: [supplier], distributors: [distributor], coordinator: create(:distributor_enterprise), variants: [product.master]) }
let(:enterprise_fee) { create(:enterprise_fee, amount: 1.23) }
let(:product) { create(:simple_product, supplier: supplier) }
let(:order) { create(:order, order_cycle: order_cycle, distributor: distributor) }
before do
add_enterprise_fee enterprise_fee
set_order order
add_product_to_cart
end
it "shows the current distributor oncheckout" do
it "shows the current distributor on checkout" do
visit checkout_path
page.should have_content distributor.name
end
describe "with shipping methods" do
let(:sm1) { create(:shipping_method, require_ship_address: true, name: "Frogs", description: "yellow") }
let(:sm2) { create(:shipping_method, require_ship_address: false, name: "Donkeys", description: "blue") }
let(:sm2) { create(:shipping_method, require_ship_address: false, name: "Donkeys", description: "blue", calculator: Spree::Calculator::FlatRate.new(preferred_amount: 4.56)) }
before do
distributor.shipping_methods << sm1
distributor.shipping_methods << sm2
distributor.shipping_methods << sm1
distributor.shipping_methods << sm2
end
context "on the checkout page" do
@@ -39,6 +41,15 @@ feature "As a consumer I want to check out my cart", js: true do
checkout_as_guest
end
it "shows a breakdown of the order price" do
toggle_shipping
choose sm2.name
page.should have_selector 'orderdetails .cart-total', text: "$11.23"
page.should have_selector 'orderdetails .shipping', text: "$4.56"
page.should have_selector 'orderdetails .total', text: "$15.79"
end
it "shows all shipping methods, but doesn't show ship address when not needed" do
toggle_shipping
page.should have_content "Frogs"
@@ -157,7 +168,7 @@ feature "As a consumer I want to check out my cart", js: true do
# Order should have a payment with the correct amount
o = Spree::Order.complete.first
o.payments.first.amount.should == 10
o.payments.first.amount.should == 11.23
end
it "shows the payment processing failed message when submitted with an invalid credit card" do

View File

@@ -0,0 +1,14 @@
describe "Shipping method service", ->
ShippingMethods = null
shippingMethods = [
{id: 1, price: "1.2"}
]
beforeEach ->
module 'Darkswarm'
angular.module('Darkswarm').value('shippingMethods', shippingMethods)
inject ($injector)->
ShippingMethods = $injector.get("ShippingMethods")
it "converts price to float", ->
expect(ShippingMethods.shipping_methods[0].price).toEqual 1.2

View File

@@ -7,13 +7,21 @@ module ShopWorkflow
have_selector ".price", text: price
end
def add_enterprise_fee(enterprise_fee)
order_cycle.exchanges.outgoing.first.enterprise_fees << enterprise_fee
end
def set_order(order)
ApplicationController.any_instance.stub(:session).and_return({order_id: order.id, access_token: order.token})
end
def add_product_to_cart
create(:line_item, variant: product.master, order: order)
order.reload.save! # Recalculate totals
order.reload
# Recalculate totals
order.save!
order.update_distribution_charge!
end
def toggle_accordion(name)