lib/helpers/record_test_helper.rb
def assert_valid_format(record, field, values)
    values.each do |value|
      record.send("#{field}=", value)
      assert record.valid?, "#{record.class} invalid with value '#{value}' for '#{field}'"
    end
  end
# Checks that each value is valid for that field within the record
# ex. assert_valid_format(@user, :mobile_number, [ 'foo', 'bar' ]
# checks that 'foo', 'bar', are acceptable values for the mobile number field
Checks that each value is valid for that field within the record
ex.
Checks that each value is valid for that field within the record ex .
def assert_valid_format(record, field, values)
    values.each do |value|
      record.send("#{field}=", value)
      assert record.valid?, "#{record.class} invalid with value '#{value}' for '#{field}'"
    end
  end
def assert_valid_format ( record , field , values ) values . each do | value | record . send ( "#{field}=" , value ) assert record . valid? , "#{record.class} invalid with value '#{value}' for '#{field}'" end end
Checks that each value is valid for that field within the record
ex.
Checks that each value is valid for that field within the record ex .
record
field
values