Skip to content

Instantly share code, notes, and snippets.

@mileszs
Created November 9, 2009 15:52
Show Gist options
  • Select an option

  • Save mileszs/230045 to your computer and use it in GitHub Desktop.

Select an option

Save mileszs/230045 to your computer and use it in GitHub Desktop.
586) Error:
test_update_should_fail_if_version_invalid(VersionsControllerTest):
NoMethodError: You have a nil object when you didn't expect it!
The error occurred while evaluating nil.each_pair
/usr/lib/ruby/gems/1.8/gems/acts_as_ferret-0.4.4/lib/instance_methods.rb:136:in `to_doc'
/usr/lib/ruby/gems/1.8/gems/acts_as_ferret-0.4.4/lib/instance_methods.rb:128:in `to_doc'
/usr/lib/ruby/gems/1.8/gems/acts_as_ferret-0.4.4/lib/local_index.rb:106:in `<<'
/usr/lib/ruby/gems/1.8/gems/acts_as_ferret-0.4.4/lib/instance_methods.rb:100:in `ferret_create'
lib/user_stamp.rb:19:in `create'
/usr/lib/ruby/gems/1.8/gems/thoughtbot-factory_girl-1.2.2/lib/factory_girl/proxy/create.rb:5:in `result'
/usr/lib/ruby/gems/1.8/gems/thoughtbot-factory_girl-1.2.2/lib/factory_girl/factory.rb:293:in `run'
/usr/lib/ruby/gems/1.8/gems/thoughtbot-factory_girl-1.2.2/lib/factory_girl/factory.rb:237:in `create'
/usr/lib/ruby/gems/1.8/gems/thoughtbot-factory_girl-1.2.2/lib/factory_girl/proxy/build.rb:21:in `association'
test/factories.rb:619
/usr/lib/ruby/gems/1.8/gems/thoughtbot-factory_girl-1.2.2/lib/factory_girl/attribute/dynamic.rb:11:in `call'
/usr/lib/ruby/gems/1.8/gems/thoughtbot-factory_girl-1.2.2/lib/factory_girl/attribute/dynamic.rb:11:in `add_to'
/usr/lib/ruby/gems/1.8/gems/thoughtbot-factory_girl-1.2.2/lib/factory_girl/factory.rb:290:in `run'
/usr/lib/ruby/gems/1.8/gems/thoughtbot-factory_girl-1.2.2/lib/factory_girl/factory.rb:288:in `each'
/usr/lib/ruby/gems/1.8/gems/thoughtbot-factory_girl-1.2.2/lib/factory_girl/factory.rb:288:in `run'
/usr/lib/ruby/gems/1.8/gems/thoughtbot-factory_girl-1.2.2/lib/factory_girl/factory.rb:237:in `create'
/usr/lib/ruby/gems/1.8/gems/thoughtbot-factory_girl-1.2.2/lib/factory_girl/factory.rb:268:in `send'
/usr/lib/ruby/gems/1.8/gems/thoughtbot-factory_girl-1.2.2/lib/factory_girl/factory.rb:268:in `default_strategy'
/usr/lib/ruby/gems/1.8/gems/thoughtbot-factory_girl-1.2.2/lib/factory_girl.rb:20:in `Factory'
/test/functional/versions_controller_test.rb:16:in `setup'
####### test/factories.rb
618 Factory.define :software_product do |s|
619 s.vendor { |a| a.association(:org) }
620 s.name 'foo'
621 s.operating_system false
622 end
#######
####### test/factories.rb
1 Factory.sequence(:text_id) { |n| "foo_#{n}" }
2
3 Factory.define :org, :class => Organization do |org|
4 org.name 'nframe'
5 org.customer_number '60000001'
6 org.passphrase 'N/A'
7 org.roa_id 41
8 org.text_id { Factory.next :text_id }
9 org.url 'foo'
10 org.notes 'foo'
11 end
#######
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment