Sha256: 7682b121b46d6d84af993766cac7a6d9ead6759955876cca3df38e2268bfb508

Contents?: true

Size: 961 Bytes

Versions: 15

Compression:

Stored size: 961 Bytes

Contents

require 'spec_helper'
require 'integration/block_validator/spec_helper'

describe 'DataMapper::Validations::Fixtures::G3Concert' do
  before :all do
    @model = DataMapper::Validations::Fixtures::G3Concert.new(:year => 2004, :participants => "Joe Satriani, Steve Vai, Yngwie Malmsteen", :city => "Denver")
    @model.should be_valid
  end

  describe "some non existing year/participants/city combination" do
    before :all do
      @model.year = 2015
    end

    it_should_behave_like "invalid model"

    it "uses error messages returned by the validation block" do
      @model.errors.on(:participants).should == [ 'this G3 is probably yet to take place' ]
    end
  end


  describe "existing year/participants/city combination" do
    before :all do
      @model.year         = 2001
      @model.city         = "Los Angeles"
      @model.participants = "Joe Satriani, Steve Vai, John Petrucci"
    end

    it_should_behave_like "valid model"
  end
end

Version data entries

15 entries across 15 versions & 3 rubygems

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