[Activesfdc-news] valid? gives incorrect result

David James davidj503 at gmail.com
Wed Sep 5 11:21:24 EDT 2007


Dear ActiveSalesforce Community,

I wanted to call attention to a bug:
http://rubyforge.org/tracker/index.php?func=detail&aid=13501&group_id=1201&atid=4729

In short, not being able to trust valid? makes unit testing ASF problematic.

-David

Detailed description

class SfContact < ActiveRecord::Base
  establish_connection :salesforce
  include ActiveSalesforce::ActiveRecord::Mixin
  set_table_name "contact"
end

# script/console

contact1 = SfContact.new
contact1.save
# actual result: ActiveSalesforce::ASFError:
statusCodeREQUIRED_FIELD_MISSINGfieldsLastNamemessageRequired fields
are
missing: [LastName]
# expected result: same (better use of whitespace would be nice, though)

contact2 = SfContact.new
contact2.valid?
# actual result: true
# expected result: false


More information about the Activesfdc-news mailing list