mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-10 03:30:22 +00:00
Minor regressions and bug fixes
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
class Api::MasterVariantSerializer < ActiveModel::Serializer
|
||||
attributes :id, :is_master, :count_on_hand, :name_to_display, :unit_to_display, :count_on_hand, :on_demand
|
||||
has_many :images, serializer: Api::TaxonImageSerializer
|
||||
end
|
||||
@@ -37,7 +37,7 @@ class Api::CachedProductSerializer < ActiveModel::Serializer
|
||||
|
||||
has_one :supplier, serializer: Api::IdSerializer
|
||||
has_one :primary_taxon, serializer: Api::TaxonSerializer
|
||||
has_one :master, serializer: Api::MasterVariantSerializer
|
||||
has_one :master, serializer: Api::VariantSerializer
|
||||
|
||||
def variants
|
||||
object.variants_for(options[:current_order_cycle], options[:current_distributor]).in_stock
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
class Api::VariantSerializer < ActiveModel::Serializer
|
||||
attributes :id, :is_master, :count_on_hand, :name_to_display, :on_demand,
|
||||
:price
|
||||
attributes :id, :is_master, :count_on_hand, :name_to_display, :unit_to_display, :on_demand
|
||||
attributes :price
|
||||
attributes :id, :is_master, :count_on_hand, :name_to_display, :unit_to_display,
|
||||
:on_demand, :price
|
||||
has_many :images, serializer: Api::ImageSerializer
|
||||
|
||||
def price
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
.small-4.medium-2.large-2.columns.variant-price
|
||||
.table-cell
|
||||
%i.ofn-i_009-close
|
||||
{{ product.price | currency }}
|
||||
{{ product.master.price | currency }}
|
||||
%button.graph-button{"price-breakdown" => "_",
|
||||
"variant" => "product.master",
|
||||
"price-breakdown-animation" => "true"}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
%em {{ variant.unit_to_display }}
|
||||
|
||||
.small-4.medium-2.large-2.columns.variant-price
|
||||
.table-cell
|
||||
.table-cell.price
|
||||
%i.ofn-i_009-close
|
||||
{{ variant.price | currency }}
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ feature "As a consumer I want to shop with a distributor", js: true do
|
||||
exchange.variants << product.master
|
||||
|
||||
visit shop_path
|
||||
save_screenshot "/users/willmarshall/Desktop/wtsvg.png"
|
||||
find("#tab_producers a").click
|
||||
page.should have_content supplier.name
|
||||
end
|
||||
@@ -77,7 +76,7 @@ feature "As a consumer I want to shop with a distributor", js: true do
|
||||
page.should have_content "Next order closing in 2 days"
|
||||
Spree::Order.last.order_cycle.should == oc1
|
||||
page.should have_content product.name
|
||||
page.should have_content product.master.display_name
|
||||
page.should have_content product.master.display_name.capitalize
|
||||
page.should have_content product.master.display_as
|
||||
|
||||
open_product_modal product
|
||||
@@ -112,8 +111,8 @@ feature "As a consumer I want to shop with a distributor", js: true do
|
||||
visit shop_path
|
||||
|
||||
# Page should not have product.price (with or without fee)
|
||||
page.should_not have_price "from $10.00"
|
||||
page.should_not have_price "from $33.00"
|
||||
page.should_not have_price "$10.00"
|
||||
page.should_not have_price "$33.00"
|
||||
|
||||
# Page should have variant prices (with fee)
|
||||
page.should have_price "$43.00"
|
||||
@@ -121,7 +120,7 @@ feature "As a consumer I want to shop with a distributor", js: true do
|
||||
|
||||
# Product price should be listed as the lesser of these
|
||||
#page.should have_selector 'tr.product > td', text: "from $43.00"
|
||||
page.should have_price "from $43.00"
|
||||
page.should have_price "$43.00"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -140,8 +139,7 @@ feature "As a consumer I want to shop with a distributor", js: true do
|
||||
it "should save group buy data to ze cart" do
|
||||
fill_in "variants[#{product.master.id}]", with: 5
|
||||
fill_in "variant_attributes[#{product.master.id}][max_quantity]", with: 9
|
||||
add_to_cart
|
||||
page.should have_content product.name
|
||||
sleep 5
|
||||
li = Spree::Order.order(:created_at).last.line_items.order(:created_at).last
|
||||
li.max_quantity.should == 9
|
||||
li.quantity.should == 5
|
||||
|
||||
Reference in New Issue
Block a user