For a product with one or more on_demand variants, don't show 'On demand' at the product level

This commit is contained in:
Rohan Mitchell
2014-01-17 16:02:05 +11:00
parent ed78cc053b
commit 87cf596a30
4 changed files with 24 additions and 2 deletions

View File

@@ -555,6 +555,24 @@ describe "AdminBulkProductsCtrl", ->
expect(scope.onHand(not_variants: [])).toEqual "error"
describe "determining whether a product has variants that are available on demand", ->
it "returns true when at least one variant does", ->
product =
variants: [
{on_demand: false}
{on_demand: true}
]
expect(scope.hasOnDemandVariants(product)).toBe(true)
it "returns false otherwise", ->
product =
variants: [
{on_demand: false}
{on_demand: false}
]
expect(scope.hasOnDemandVariants(product)).toBe(false)
describe "submitting products to be updated", ->
describe "packing products", ->
it "extracts variant_unit_with_scale into variant_unit and variant_unit_scale", ->