Sha256: 2f2e1f1ffc0f48a5382e02e9c7c972111f410145f8062034ddd0c9fa5373a479

Contents?: true

Size: 536 Bytes

Versions: 10

Compression:

Stored size: 536 Bytes

Contents

require 'spec_helper'

describe Spree::ShippingCategory, :type => :model do

  describe '#validations' do
    it 'should have a valid factory' do
      expect(FactoryGirl.build(:shipping_category)).to be_valid
    end

    it 'should require name' do
      expect(FactoryGirl.build(:shipping_category, name: '')).not_to be_valid
    end

    it 'should validate uniqueness' do
      FactoryGirl.create(:shipping_category, name: 'Test')
      expect(FactoryGirl.build(:shipping_category, name: 'Test')).not_to be_valid
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spree_core-3.1.5 spec/models/spree/shipping_category_spec.rb
spree_core-3.1.4 spec/models/spree/shipping_category_spec.rb
spree_core-3.1.3 spec/models/spree/shipping_category_spec.rb
spree_core-3.1.2 spec/models/spree/shipping_category_spec.rb
spree_core-3.1.1 spec/models/spree/shipping_category_spec.rb
spree_core-3.1.0 spec/models/spree/shipping_category_spec.rb
spree_core-3.1.0.rc4 spec/models/spree/shipping_category_spec.rb
spree_core-3.1.0.rc3 spec/models/spree/shipping_category_spec.rb
spree_core-3.1.0.rc2 spec/models/spree/shipping_category_spec.rb
spree_core-3.1.0.rc1 spec/models/spree/shipping_category_spec.rb