Sha256: f83eb0cebd26db3969b170e32ecbca9018ab9a523514b3458614338e12a00191

Contents?: true

Size: 840 Bytes

Versions: 21

Compression:

Stored size: 840 Bytes

Contents

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

module OptionTypeSpecHelper
  def valid_option_type_attributes
    {
      :name => "an_option_type",
      :presentation => "An Option Type"
    }
  end
end


describe OptionType do
  include OptionTypeSpecHelper

  before(:each) do
    @option_type = OptionType.new
  end

  it "should not be valid when empty" do
    @option_type.should_not be_valid
  end

  ['name', 'presentation'].each do |field|
    it "should require #{field}" do
      @option_type.should_not be_valid
      @option_type.errors.full_messages.should include("#{field.humanize} #{I18n.translate("activerecord.errors.messages.blank")}")
    end
  end

  it "should be valid when having correct information" do
    @option_type.attributes = valid_option_type_attributes
    @option_type.should be_valid
  end
  
end

Version data entries

21 entries across 21 versions & 3 rubygems

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