Displaying 1 result from an estimated 1 matches for "valid_message_attributes".
2008 Jan 11
5
Missing methods
...ry
%w(account friendship person invitation message asset email_address
birth).each do |klass|
eval <<-EOF
def self.create_#{klass}(attributes = {})
default_attributes = valid_#{klass}_attributes
#{klass.camelize}.create! default_attributes.merge(attributes)
end
EOF
end
def valid_message_attributes(options = {})
{
#some message options
}
end
#more valid_x_attributes methods
end
When I require this file in a spec file, Factory.create_person works
fine. When I try to do it in a step file, Factory.create_person is
defined, but it fails because valid_person_attributes is missing. If...