Sha256: 9a3ada9284973e76ada3db8f35fcf1664d0f11c3963e97f5df5672973d434af8

Contents?: true

Size: 988 Bytes

Versions: 23

Compression:

Stored size: 988 Bytes

Contents

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

module OptionValueSpecHelper
  def valid_option_value_attributes
    {
      :name => "an_option_value",
      :presentation => "An Option Value",
      :position => 1
    }
  end
end


describe OptionValue do
  include OptionValueSpecHelper

  before(:each) do
    @option_value = OptionValue.new
  end

  it "should not be valid when empty" do
    pending "Shouldn't it require a name and a presentation?"
    @option_value.should_not be_valid
  end

  ['name', 'presentation'].each do |field|
    it "should require #{field}" do
      pending "Shouldn't it require a name and a presentation?"
      @option_value.should_not be_valid
      @option_value.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
    @option_value.attributes = valid_option_value_attributes
    @option_value.should be_valid
  end
  
end

Version data entries

23 entries across 23 versions & 3 rubygems

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