Sha256: 6644efdb73308b6d65939b9d92a1917fb1d7cfc2ba1d8030c7b26f26d585454e
Contents?: true
Size: 836 Bytes
Versions: 11
Compression:
Stored size: 836 Bytes
Contents
require 'rails_helper' RSpec.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
11 entries across 11 versions & 1 rubygems