Sha256: 6f33a5c664fdab09c9d745c74ca474a6bd1f8ac9474cba56cf563424d3ebd6ee

Contents?: true

Size: 478 Bytes

Versions: 15

Compression:

Stored size: 478 Bytes

Contents

require "spec_helper"

describe BazaModels::Model::CustomValidations do
  include DatabaseHelper

  let(:user) { User.new(email: "test@example.com") }

  it "validates custom validations" do
    user.custom_valid = false
    expect(user.valid?).to eq false
    expect(user.errors.full_messages.join(". ")).to eq "Custom validate failed"
    expect(user.save).to eq false

    user.custom_valid = nil
    expect(user.valid?).to eq true
    expect(user.save).to eq true
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
baza_models-0.0.15 spec/baza_models/model/custom_validations_spec.rb
baza_models-0.0.14 spec/baza_models/model/custom_validations_spec.rb
baza_models-0.0.13 spec/baza_models/model/custom_validations_spec.rb
baza_models-0.0.12 spec/baza_models/model/custom_validations_spec.rb
baza_models-0.0.11 spec/baza_models/model/custom_validations_spec.rb
baza_models-0.0.10 spec/baza_models/model/custom_validations_spec.rb
baza_models-0.0.9 spec/baza_models/model/custom_validations_spec.rb
baza_models-0.0.8 spec/baza_models/model/custom_validations_spec.rb
baza_models-0.0.7 spec/baza_models/model/custom_validations_spec.rb
baza_models-0.0.6 spec/baza_models/model/custom_validations_spec.rb
baza_models-0.0.5 spec/baza_models/model/custom_validations_spec.rb
baza_models-0.0.4 spec/baza_models/model/custom_validations_spec.rb
baza_models-0.0.3 spec/baza_models/model/custom_validations_spec.rb
baza_models-0.0.2 spec/baza_models/model/custom_validations_spec.rb
baza_models-0.0.1 spec/baza_models/model/custom_validations_spec.rb