Hello,

I have some tests that run fine with rails 4.0 which use factory_girl and
rspec and they fail using Rails 4.0.1.rc4

My rspec and factory_girl gems are up to date and the problem only appears
once I get on rc4 rails.

Has anybody else had issues running there specs using factory girl on the
latest release candidate?  Any pointers or gotchas that I might be missing?

Here's my stacktrace if it helps:

Failure/Error: user = FactoryGirl.create(:user)
NoMethodError:
undefined method `[]' for nil:NilClass
#
/home/user/.gem/ruby/2.0.0/gems/activerecord-4.0.1.rc4/lib/active_record/attribute_methods/read.rb:86:in
`block in read_attribute'
#
/home/user/.gem/ruby/2.0.0/gems/activerecord-4.0.1.rc4/lib/active_record/attribute_methods/read.rb:84:in
`fetch'
#
/home/user/.gem/ruby/2.0.0/gems/activerecord-4.0.1.rc4/lib/active_record/attribute_methods/read.rb:84:in
`read_attribute'
#
/home/user/.gem/ruby/2.0.0/gems/activerecord-4.0.1.rc4/lib/active_record/attribute_methods/read.rb:59:in
`__temp__9646'
#
/home/user/.gem/ruby/2.0.0/gems/activerecord-4.0.1.rc4/lib/active_record/transactions.rb:341:in
`remember_transaction_record_state'
#
/home/user/.gem/ruby/2.0.0/gems/activerecord-4.0.1.rc4/lib/active_record/transactions.rb:311:in
`add_to_transaction'
#
/home/user/.gem/ruby/2.0.0/gems/activerecord-4.0.1.rc4/lib/active_record/transactions.rb:324:in
`block in with_transaction_returning_status'
#
/home/user/.gem/ruby/2.0.0/gems/activerecord-4.0.1.rc4/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in
`block in transaction'
#
/home/user/.gem/ruby/2.0.0/gems/activerecord-4.0.1.rc4/lib/active_record/connection_adapters/abstract/database_statements.rb:210:in
`within_new_transaction'
#
/home/user/.gem/ruby/2.0.0/gems/activerecord-4.0.1.rc4/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in
`transaction'
#
/home/user/.gem/ruby/2.0.0/gems/activerecord-4.0.1.rc4/lib/active_record/transactions.rb:209:in
`transaction'
#
/home/user/.gem/ruby/2.0.0/gems/activerecord-4.0.1.rc4/lib/active_record/transactions.rb:323:in
`with_transaction_returning_status'
#
/home/user/.gem/ruby/2.0.0/gems/activerecord-4.0.1.rc4/lib/active_record/transactions.rb:275:in
`save!'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/configuration.rb:14:in
`block in initialize'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/evaluation.rb:15:in
`[]'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/evaluation.rb:15:in
`create'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/strategy/create.rb:12:in
`block in result'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/strategy/create.rb:9:in
`tap'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/strategy/create.rb:9:in
`result'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/factory.rb:42:in
`run'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/factory_runner.rb:23:in
`block in run'
#
/home/user/.gem/ruby/2.0.0/gems/activesupport-4.0.1.rc4/lib/active_support/notifications.rb:161:in
`instrument'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/factory_runner.rb:22:in
`run'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/strategy/create.rb:5:in
`association'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/evaluator.rb:31:in
`association'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/attribute/association.rb:19:in
`block in to_proc'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/evaluator.rb:71:in
`instance_exec'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/evaluator.rb:71:in
`block in define_attribute'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/attribute_assigner.rb:56:in
`get'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/attribute_assigner.rb:16:in
`block (2 levels) in object'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/attribute_assigner.rb:15:in
`each'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/attribute_assigner.rb:15:in
`block in object'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/attribute_assigner.rb:14:in
`tap'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/attribute_assigner.rb:14:in
`object'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/evaluation.rb:12:in
`object'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/strategy/create.rb:9:in
`result'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/factory.rb:42:in
`run'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/factory_runner.rb:23:in
`block in run'
#
/home/user/.gem/ruby/2.0.0/gems/activesupport-4.0.1.rc4/lib/active_support/notifications.rb:161:in
`instrument'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/factory_runner.rb:22:in
`run'
#
/home/user/.gem/ruby/2.0.0/gems/factory_girl-4.2.0/lib/factory_girl/strategy_syntax_method_registrar.rb:19:in
`block in define_singular_strategy_method'
# ./spec/controllers/secure_files_controller_spec.rb:5:in `block (2 levels)
in <top (required)>'

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to