Sha256: f2a6414666b5cb1302925590132451ccc83d460efe03945f9a4aa8ffad0e8ad0

Contents?: true

Size: 758 Bytes

Versions: 16

Compression:

Stored size: 758 Bytes

Contents

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

module PrototypeSpecHelper
  def valid_prototype_attributes
    {
      :name => "A Prototype"
    }
  end
end


describe Prototype do
  include PrototypeSpecHelper

  before(:each) do
    @prototype = Prototype.new
  end

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

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

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

end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
kdmny-spree-0.0.1 spec/models/prototype_spec.rb
spree-enriquez-0.9.4 spec/models/prototype_spec.rb
spree-0.9.4 spec/models/prototype_spec.rb
spree-0.9.3 spec/models/prototype_spec.rb
spree-0.9.2 spec/models/prototype_spec.rb
spree-0.9.1 spec/models/prototype_spec.rb
spree-0.9.0 spec/models/prototype_spec.rb
spree-0.8.4 spec/models/prototype_spec.rb
spree-0.8.5 spec/models/prototype_spec.rb
spree-0.6.0 spec/models/prototype_spec.rb
spree-0.7.1 spec/models/prototype_spec.rb
spree-0.7.0 spec/models/prototype_spec.rb
spree-0.8.0 spec/models/prototype_spec.rb
spree-0.8.1 spec/models/prototype_spec.rb
spree-0.8.2 spec/models/prototype_spec.rb
spree-0.8.3 spec/models/prototype_spec.rb