lib/helpers/record_test_helper.rb
# Checks that each value is invalid for that field within the record
# record = activerecord object
# field  = symbol attribute name
# values = array of string values to try
#
# ex. assert_invalid_format(@user, :mobile_number, [ 'foo', 'bar' ])
# checks that 'foo', 'bar', are not acceptable values for the mobile number field
#
Checks that each value is invalid for that field within the record
record = activerecord object
field  = symbol attribute name
values = array of string values to try

ex.
Checks that each value is invalid for that field within the record record = activerecord object field = symbol attribute name values = array of string values to try ex .
def assert_invalid_format(record, field, values)
    values = [ values ] unless values.respond_to? :each 
    values.each do |value|
      record.send("#{field}=", value)
      assert_invalid_attribute(record, field)
    end
  end
def assert_invalid_format ( record , field , values ) values = [ values ] unless values . respond_to? :each values . each do | value | record . send ( "#{field}=" , value ) assert_invalid_attribute ( record , field ) end end
Checks that each value is invalid for that field within the record
record = activerecord object
field  = symbol attribute name
values = array of string values to try
Checks that each value is invalid for that field within the record record = activerecord object field = symbol attribute name values = array of string values to try
# convert to array
record
field
values