How to create factories with attr_accesible?
        Posted  
        
            by 
                regedarek
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by regedarek
        
        
        
        Published on 2012-06-25T09:12:57Z
        Indexed on 
            2012/06/25
            9:15 UTC
        
        
        Read the original article
        Hit count: 283
        
How to deal with factories and attr_accessible?
My example:
# model
class SomeModel
  attr_accessible :name, full_name, other_name
end
#spec
require 'spec_helper'
describe "test" do
  it do
    create(:some_model, name: "test name", user: User.first) #factory
  end
end
#error
ruby(17122,0x12a055000) malloc: *** error for object 0x8: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
I think the error is because user_id is not in attr_accesible atributes
© Stack Overflow or respective owner