Sha256: 74491ed5c3a6f572704d51046bd8bf197d9f6bfc138d04d7531c5cd8d951a6c0

Contents?: true

Size: 823 Bytes

Versions: 2

Compression:

Stored size: 823 Bytes

Contents

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

module PropertySpecHelper
  def valid_property_attributes
    {
      :name => "a_property",
      :presentation => "A Property"
    }
  end
end


describe Property do
  include PropertySpecHelper

  before(:each) do
    @property = Property.new
  end

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

  ['name', 'presentation'].each do |field|
    it "should require #{field}" do
      @property.should_not be_valid
      @property.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
    @property.attributes = valid_property_attributes
    @property.should be_valid
  end

  it "should find all by prototype"
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree-0.5.0 spec/models/property_spec.rb
spree-0.5.1 spec/models/property_spec.rb