Sha256: 602d81c423b88ac12f4692f217fe67461046c365e924543b8347cfefa2dd3a6f

Contents?: true

Size: 388 Bytes

Versions: 1

Compression:

Stored size: 388 Bytes

Contents

module Modelizer
  module Assertions
    def assert_invalid attribute, model, match = nil
      assert !model.valid?, "#{model.class.name} should be valid, but isn't."

      assert !model.errors.on(attribute).blank?,
      "No error on #{attribute}, but: " +
        model.errors.full_messages.to_sentence

      assert_match match, model.errors.on(attribute) if match
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
modelizer-1.1.0 lib/modelizer/assertions.rb