Changed name enable_reset to resettable in Variant Overrides table & updated views, specs accordingly

This commit is contained in:
Steve Pettitt
2015-11-28 20:55:55 +00:00
committed by Rob Harrington
parent 25454d3e97
commit e423e890e0
11 changed files with 57 additions and 47 deletions

View File

@@ -89,18 +89,18 @@ describe VariantOverride do
describe "resetting stock levels" do
it "resets the on hand level to the value in the default_stock field" do
vo = create(:variant_override, variant: variant, hub: hub, count_on_hand: 12, default_stock: 20, enable_reset: true)
vo = create(:variant_override, variant: variant, hub: hub, count_on_hand: 12, default_stock: 20, resettable: true)
vo.reset_stock!
vo.reload.count_on_hand.should == 20
end
it "silently logs an error if the variant override doesn't have a default stock level" do
vo = create(:variant_override, variant: variant, hub: hub, count_on_hand: 12, default_stock:nil, enable_reset: true)
vo = create(:variant_override, variant: variant, hub: hub, count_on_hand: 12, default_stock:nil, resettable: true)
Bugsnag.should_receive(:notify)
vo.reset_stock!
vo.reload.count_on_hand.should == 12
end
it "doesn't reset the level if the behaviour is disabled" do
vo = create(:variant_override, variant: variant, hub: hub, count_on_hand: 12, default_stock: 10, enable_reset: false)
vo = create(:variant_override, variant: variant, hub: hub, count_on_hand: 12, default_stock: 10, resettable: false)
vo.reset_stock!
vo.reload.count_on_hand.should == 12
end