Sha256: 4221323890d5d1e91b1c43d5dec2a1b65ed50c67bf628f33f523c4e245f16923

Contents?: true

Size: 538 Bytes

Versions: 3

Compression:

Stored size: 538 Bytes

Contents

require_relative '../../spec_helper'
require_relative 'spec_helper'

describe 'SailBoat' do
  before :all do
    SailBoat.auto_migrate!

    @model = SailBoat.new(:id => 1)
    expect(@model).to be_valid_for_primitive_test
  end

  describe "with invlid value assigned to primitive column" do
    before :all do
      @model.build_date = 'ABC'
    end

    it "is invalid" do
      expect(@model).not_to be_valid_for_primitive_test
      expect(@model.errors.on(:build_date)).to eq [ 'Build date must be of type Date' ]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sbf-dm-validations-1.4.0 spec/integration/automatic_validation/inferred_primitive_validation_spec.rb
sbf-dm-validations-1.3.0 spec/integration/automatic_validation/inferred_primitive_validation_spec.rb
sbf-dm-validations-1.3.0.beta spec/integration/automatic_validation/inferred_primitive_validation_spec.rb