Sha256: 538c14328a8af35510dcba796b84febbcfa288b7629d51bb78bc2052915cefc8

Contents?: true

Size: 1017 Bytes

Versions: 23

Compression:

Stored size: 1017 Bytes

Contents

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

module ProductOptionTypeSpecHelper
  def valid_product_option_type_attributes
    {
      :position => 1
    }
  end
end


describe ProductOptionType do
  include ProductOptionTypeSpecHelper

  before(:each) do
    @product_option_type = ProductOptionType.new
  end

  it "should not be valid when empty" do
    pending "Shouldn't it require a position?"
    @product_option_type.should_not be_valid
  end

  ['position'].each do |field|
    it "should require #{field}" do
      pending "Shouldn't it require a position?"
      @product_option_type.should_not be_valid
      @product_option_type.errors.full_messages.should include("#{field.intern.l(field).humanize} #{:error_message_blank.l}")
    end
  end

  it "should be valid when having correct information" do
    pending "Shouldn't it require a product and an option type too?"
    @product_option_type.attributes = valid_product_option_type_attributes
    @product_option_type.should be_valid
  end

end

Version data entries

23 entries across 23 versions & 3 rubygems

Version Path
kdmny-spree-0.0.1 spec/models/product_option_type_spec.rb
spree-0.11.0 spec/models/product_option_type_spec.rb
spree-0.10.2 spec/models/product_option_type_spec.rb
spree-0.10.1 spec/models/product_option_type_spec.rb
spree-0.10.0 spec/models/product_option_type_spec.rb
spree-0.10.0.beta spec/models/product_option_type_spec.rb
spree-enriquez-0.9.4 spec/models/product_option_type_spec.rb
spree-0.9.4 spec/models/product_option_type_spec.rb
spree-0.9.3 spec/models/product_option_type_spec.rb
spree-0.9.2 spec/models/product_option_type_spec.rb
spree-0.9.1 spec/models/product_option_type_spec.rb
spree-0.9.0 spec/models/product_option_type_spec.rb
spree-0.8.4 spec/models/product_option_type_spec.rb
spree-0.8.5 spec/models/product_option_type_spec.rb
spree-0.5.0 spec/models/product_option_type_spec.rb
spree-0.6.0 spec/models/product_option_type_spec.rb
spree-0.5.1 spec/models/product_option_type_spec.rb
spree-0.7.1 spec/models/product_option_type_spec.rb
spree-0.7.0 spec/models/product_option_type_spec.rb
spree-0.8.0 spec/models/product_option_type_spec.rb