Sha256: 409079279a3652a7f9374265d41ce9c2a514a82ac65662e65d1a1628e5999a55

Contents?: true

Size: 512 Bytes

Versions: 143

Compression:

Stored size: 512 Bytes

Contents

# frozen_string_literal: true

RSpec::Matchers.define :validate_timeliness_of do |attribute|
  match do |model|
    model._validators[attribute.to_sym].detect do |validator|
      validator.class == ActiveModel::Validations::TimelinessValidator &&
        validator.attributes.include?(attribute)
    end
  end

  failure_message do |_actual|
    "expect #{attribute} to validate timeliness of"
  end

  failure_message_when_negated do |_actual|
    "expect #{attribute} to not validate timeliness of"
  end
end

Version data entries

143 entries across 143 versions & 1 rubygems

Version Path
renalware-core-2.0.153 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.152 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.151 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.149 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.148 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.147 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.146 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.145 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.144 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.143 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.142 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.141 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.140 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.139 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.138 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.137 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.136 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.135 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.134 spec/support/matchers/validate_timeliness_of.rb
renalware-core-2.0.133 spec/support/matchers/validate_timeliness_of.rb