Sha256: 05d99beceec885a18402dff6900a8e2ab94772e10626eb1d0706deea89712b37

Contents?: true

Size: 1.48 KB

Versions: 26

Compression:

Stored size: 1.48 KB

Contents

require File.dirname(__FILE__) + "/../spec_helper"

describe ShopAddress do
  
  dataset :shop_addresses, :shop_orders
  
  describe 'validations' do
    before :each do
      @address = shop_billings(:order_billing)
    end
    context 'unit' do
      it 'should not require' do
        @address.unit = nil
        @address.valid?.should be_true
      end
    end
    context 'name' do
      it 'should require' do
        @address.name = nil
        @address.valid?.should be_false
      end
    end
    context 'street_1' do
      it 'should require' do
        @address.street_1 = nil
        @address.valid?.should be_false
      end
    end
    context 'street_2' do
      it 'should not require' do
        @address.street_2 = nil
        @address.valid?.should be_true
      end
    end
    context 'city' do
      it 'should require' do
        @address.city = nil
        @address.valid?.should be_false
      end
    end
    context 'postcode' do
      it 'should require' do
        @address.postcode = nil
        @address.valid?.should be_false
      end
    end
    context 'state' do
      it 'should require' do
        @address.state = nil
        @address.valid?.should be_false
      end
    end
    context 'country' do
      it 'should require' do
        @address.country = nil
        @address.valid?.should be_false
      end
    end
    context 'phone' do
      it 'should not require' do
        @address.phone = nil
        @address.valid?.should be_true
      end
    end
  end
  
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
radiant-shop-extension-0.94.7 spec/models/shop_address_spec.rb
radiant-shop-extension-0.94.6 spec/models/shop_address_spec.rb
radiant-shop-extension-0.94.5 spec/models/shop_address_spec.rb
radiant-shop-extension-0.94.4 spec/models/shop_address_spec.rb
radiant-shop-extension-0.94.3 spec/models/shop_address_spec.rb
radiant-shop-extension-0.94.2 spec/models/shop_address_spec.rb
radiant-shop-extension-0.94.1 spec/models/shop_address_spec.rb
radiant-shop-extension-0.94.0 spec/models/shop_address_spec.rb
radiant-shop-extension-0.93.3 spec/models/shop_address_spec.rb
radiant-shop-extension-0.93.2 spec/models/shop_address_spec.rb
radiant-shop-extension-0.93.1 spec/models/shop_address_spec.rb
radiant-shop-extension-0.93.0 spec/models/shop_address_spec.rb
radiant-shop-extension-0.92.11 spec/models/shop_address_spec.rb
radiant-shop-extension-0.92.10 spec/models/shop_address_spec.rb
radiant-shop-extension-0.92.9 spec/models/shop_address_spec.rb
radiant-shop-extension-0.92.8 spec/models/shop_address_spec.rb
radiant-shop-extension-0.92.7 spec/models/shop_address_spec.rb
radiant-shop-extension-0.92.6 spec/models/shop_address_spec.rb
radiant-shop-extension-0.92.3 spec/models/shop_address_spec.rb
radiant-shop-extension-0.92.2 spec/models/shop_address_spec.rb