Sha256: 28f516c83344bd9f5ef96e8b4ebb21bfe2d92913c3cd924d6ef5b581f24e5915

Contents?: true

Size: 1.02 KB

Versions: 15

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'
require 'integration/numeric_validator/spec_helper'

describe 'DataMapper::Validations::Fixtures::LerneanHydra' do
  before :all do
    DataMapper::Validations::Fixtures::LerneanHydra.auto_migrate!
  end

  describe "with valid set of attributes" do
    before :all do
      @model = DataMapper::Validations::Fixtures::LerneanHydra.valid_instance
      @model.valid?
    end

    it_should_behave_like "valid model"
  end


  describe "with 9 heads" do
    before :all do
      @model = DataMapper::Validations::Fixtures::LerneanHydra.valid_instance(:head_count => 9)
      @model.valid?
    end

    it_should_behave_like "valid model"
  end


  describe "with only 3 heads" do
    before :all do
      @model = DataMapper::Validations::Fixtures::LerneanHydra.valid_instance(:head_count => 3)
      @model.valid?
    end

    it_should_behave_like "invalid model"

    it "has a meaningful error message" do
      @model.errors.on(:head_count).should == [ 'Lernean hydra is said to have exactly 9 heads' ]
    end
  end
end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
ardm-validations-1.2.0 spec/integration/numeric_validator/equality_with_integer_type_spec.rb
aequitas-0.0.1 spec_legacy/integration/numeric_validator/equality_with_integer_type_spec.rb
dm-validations-1.2.0 spec/integration/numeric_validator/equality_with_integer_type_spec.rb
dm-validations-1.2.0.rc2 spec/integration/numeric_validator/equality_with_integer_type_spec.rb
dm-validations-1.2.0.rc1 spec/integration/numeric_validator/equality_with_integer_type_spec.rb
dm-validations-1.1.0 spec/integration/numeric_validator/equality_with_integer_type_spec.rb
dm-validations-1.1.0.rc3 spec/integration/numeric_validator/equality_with_integer_type_spec.rb
dm-validations-1.1.0.rc2 spec/integration/numeric_validator/equality_with_integer_type_spec.rb
dm-validations-1.1.0.rc1 spec/integration/numeric_validator/equality_with_integer_type_spec.rb
dm-validations-1.0.2 spec/integration/numeric_validator/equality_with_integer_type_spec.rb
dm-validations-1.0.1 spec/integration/numeric_validator/equality_with_integer_type_spec.rb
dm-validations-1.0.0 spec/integration/numeric_validator/equality_with_integer_type_spec.rb
dm-validations-1.0.0.rc3 spec/integration/numeric_validator/equality_with_integer_type_spec.rb
dm-validations-1.0.0.rc2 spec/integration/numeric_validator/equality_with_integer_type_spec.rb
dm-validations-1.0.0.rc1 spec/integration/numeric_validator/equality_with_integer_type_spec.rb