Sha256: 32644df7a392902c3431669b308a205411bd6a2a94e589ed614d6f2ca1067138

Contents?: true

Size: 634 Bytes

Versions: 7

Compression:

Stored size: 634 Bytes

Contents

describe "valid model", :shared => true do
  before do
    @model.valid?
  end

  it "is valid" do
    @model.should be_valid
  end

  it "has no error messages" do
    @model.errors.should be_empty
  end

  it "has empty list of full error messages" do
    @model.errors.full_messages.should be_empty
  end
end

describe "invalid model", :shared => true do
  before do
    @model.valid?
  end

  it "is NOT valid" do
    @model.should_not be_valid
  end

  it "has error messages" do
    @model.errors.should_not be_empty
  end

  it "has list of full error messages" do
    @model.errors.full_messages.should_not be_empty
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
ardm-validations-1.2.0 spec/integration/shared/valid_and_invalid_model.rb
aequitas-0.0.1 spec_legacy/integration/shared/valid_and_invalid_model.rb
dm-validations-1.2.0 spec/integration/shared/valid_and_invalid_model.rb
dm-validations-1.2.0.rc2 spec/integration/shared/valid_and_invalid_model.rb
dm-validations-1.2.0.rc1 spec/integration/shared/valid_and_invalid_model.rb
dm-validations-1.1.0 spec/integration/shared/valid_and_invalid_model.rb
dm-validations-1.1.0.rc3 spec/integration/shared/valid_and_invalid_model.rb