Sha256: 67c7d7c6f1d457abb2c40ed39f454482ae5099d0632dce884f34d6891af84c62
Contents?: true
Size: 833 Bytes
Versions: 22
Compression:
Stored size: 833 Bytes
Contents
require 'spec_helper' describe Spree::TaxCategory, :type => :model do context 'default tax category' do let(:tax_category) { create(:tax_category) } let(:new_tax_category) { create(:tax_category) } before do tax_category.update_column(:is_default, true) end it "should undefault the previous default tax category" do new_tax_category.update_attributes({:is_default => true}) expect(new_tax_category.is_default).to be true tax_category.reload expect(tax_category.is_default).to be false end it "should undefault the previous default tax category except when updating the existing default tax category" do tax_category.update_column(:description, "Updated description") tax_category.reload expect(tax_category.is_default).to be true end end end
Version data entries
22 entries across 22 versions & 2 rubygems