Sha256: ceb8d5ff05fff59dbc8f8ab973e1458ca54757c1a57559aebf9da07021f82d68

Contents?: true

Size: 678 Bytes

Versions: 8

Compression:

Stored size: 678 Bytes

Contents

require 'spec/spec_helper'

describe ShopVariant do
  
  dataset :shop_variants, :shop_categories
  
  describe 'validations' do
    before :each do
      @variant = shop_variants(:bread_states)
    end
    
    context 'name' do
      it 'should require' do
        @variant.name = nil
        @variant.valid?.should  === false
      end
      it 'should be unique' do
        @other = shop_variants(:milk_states)
        @other.name = @variant.name
        @other.valid?.should    === false
      end
    end
    
    context 'options' do
      it 'should require' do
        @variant.options_json = nil
        @variant.valid?.should  === false
      end
    end
  end
  
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
radiant-shop_variants-extension-0.1.3 spec/models/shop_variant_spec.rb
radiant-shop_variants-extension-0.1.2 spec/models/shop_variant_spec.rb
radiant-shop_variants-extension-0.1.1 spec/models/shop_variant_spec.rb
radiant-shop_variants-extension-0.1.0 spec/models/shop_variant_spec.rb
radiant-shop_variants-extension-0.0.4 spec/models/shop_variant_spec.rb
radiant-shop_variants-extension-0.0.3 spec/models/shop_variant_spec.rb
radiant-shop_variants-extension-0.0.1 spec/models/shop_variant_spec.rb
radiant-shop-extension-0.11.6 spec/models/shop_variant_spec.rb