Revert "Can set variant_unit_name when unit type is not items" - this applies to a different field.

This reverts commit 8f6f37355c.
This commit is contained in:
Rohan Mitchell
2013-12-06 14:38:46 +11:00
parent 3013870bd6
commit 385a80a305
2 changed files with 2 additions and 5 deletions

View File

@@ -50,7 +50,7 @@
%input{ 'ng-model' => 'product.price', 'ofn-decimal' => :true, :name => 'price', 'ofn-track-product' => 'price', :type => 'text' }
%td.unit{ 'ng-show' => 'columns.unit.visible' }
%select.select2{ 'ng-model' => 'product.variant_unit_with_scale', :name => 'variant_unit_with_scale', 'ofn-track-product' => 'variant_unit_with_scale', 'ng-options' => 'unit[1] as unit[0] for unit in variant_unit_options' }
%input{ 'ng-model' => 'product.variant_unit_name', :name => 'variant_unit_name', 'ofn-track-product' => 'variant_unit_name', :type => 'text' }
%input{ 'ng-model' => 'product.variant_unit_name', :name => 'variant_unit_name', 'ofn-track-product' => 'variant_unit_name', 'ng-show' => "product.variant_unit_with_scale == 'items'", :type => 'text' }
%td{ 'ng-show' => 'columns.on_hand.visible' }
%span{ 'ng-bind' => 'product.on_hand', :name => 'on_hand', 'ng-show' => 'hasVariants(product)' }
%input.field{ 'ng-model' => 'product.on_hand', :name => 'on_hand', 'ofn-track-product' => 'on_hand', 'ng-show' => '!hasVariants(product)', :type => 'number' }

View File

@@ -189,7 +189,7 @@ feature %q{
scenario "updating a product with no variants (except master)" do
s1 = FactoryGirl.create(:supplier_enterprise)
s2 = FactoryGirl.create(:supplier_enterprise)
p = FactoryGirl.create(:product, supplier: s1, available_on: Date.today, variant_unit: 'volume', variant_unit_scale: 1, variant_unit_name: '(foo)')
p = FactoryGirl.create(:product, supplier: s1, available_on: Date.today, variant_unit: 'volume', variant_unit_scale: 1)
p.price = 10.0
p.on_hand = 6;
p.save!
@@ -203,7 +203,6 @@ feature %q{
page.should have_field "available_on", with: p.available_on.strftime("%F %T")
page.should have_field "price", with: "10.0"
page.should have_select "variant_unit_with_scale", selected: "Volume (L)"
page.should have_field "variant_unit_name", with: "(foo)"
page.should have_field "on_hand", with: "6"
fill_in "product_name", with: "Big Bag Of Potatoes"
@@ -211,7 +210,6 @@ feature %q{
fill_in "available_on", with: (Date.today-3).strftime("%F %T")
fill_in "price", with: "20"
select "Weight (kg)", from: "variant_unit_with_scale"
fill_in "variant_unit_name", with: "(bar)"
fill_in "on_hand", with: "18"
click_button 'Update'
@@ -224,7 +222,6 @@ feature %q{
page.should have_field "available_on", with: (Date.today-3).strftime("%F %T")
page.should have_field "price", with: "20.0"
page.should have_select "variant_unit_with_scale", selected: "Weight (kg)"
page.should have_field "variant_unit_name", with: "(bar)"
page.should have_field "on_hand", with: "18"
end