Skip to content

Instantly share code, notes, and snippets.

@citrus
Created July 6, 2011 17:50
Show Gist options
  • Save citrus/1067865 to your computer and use it in GitHub Desktop.
Save citrus/1067865 to your computer and use it in GitHub Desktop.
FactoryGirl - ArgumentError: Not registered: block_given?
34) Error:
test: Post should validate date time. (PostTest):
ArgumentError: Not registered: block_given?
/Users/Spencer/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-2.0.0.rc3/lib/factory_girl/registry.rb:18:in `find'
/Users/Spencer/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-2.0.0.rc3/lib/factory_girl.rb:51:in `sequence_by_name'
/Users/Spencer/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-2.0.0.rc3/lib/factory_girl/syntax/methods.rb:118:in `generate'
/Users/Spencer/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-2.0.0.rc3/lib/factory_girl/attribute/sequence.rb:11:in `add_to'
/Users/Spencer/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-2.0.0.rc3/lib/factory_girl/attribute/implicit.rb:10:in `add_to'
/Users/Spencer/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-2.0.0.rc3/lib/factory_girl/factory.rb:81:in `block in run'
/Users/Spencer/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-2.0.0.rc3/lib/factory_girl/factory.rb:79:in `each'
/Users/Spencer/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-2.0.0.rc3/lib/factory_girl/factory.rb:79:in `run'
/Users/Spencer/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-2.0.0.rc3/lib/factory_girl/syntax/methods.rb:34:in `build'
/Users/Spencer/.rvm/gems/ruby-1.9.2-p180/gems/factory_girl-2.0.0.rc3/lib/factory_girl/syntax/vintage.rb:122:in `build'
/Users/Spencer/RoR/gems/ESSENTIALS/spree_essential_blog/test/unit/post_test.rb:20:in `block in <class:PostTest>'
/Users/Spencer/.rvm/gems/ruby-1.9.2-p180/gems/shoulda-2.11.3/lib/shoulda/context.rb:382:in `call'
/Users/Spencer/.rvm/gems/ruby-1.9.2-p180/gems/shoulda-2.11.3/lib/shoulda/context.rb:382:in `block in create_test_from_should_hash'
FactoryGirl.define do
factory :post do
title "Peanut Butter Jelly Time"
posted_at { Time.now + rand(10000) }
body "Vivamus rutrum nunc non neque consectetur quis placerat neque lobortis. Nam vestibulum, arcu sodales feugiat consectetur, nisl orci bibendum elit, eu euismod magna sapien ut nibh. Donec semper quam scelerisque tortor dictum gravida. In hac habitasse platea dictumst. Nam pulvinar, odio sed rhoncus suscipit, sem diam ultrices mauris, eu consequat purus metus eu velit. Proin metus odio, aliquam eget molestie nec, gravida ut sapien. Phasellus quis est sed turpis sollicitudin venenatis sed eu odio. Praesent eget neque eu eros interdum malesuada non vel leo. Sed fringilla porta ligula egestas tincidunt. Nullam risus magna, ornare vitae varius eget, scelerisque a libero."
tag_list "peanut butter, jelly, sandwich, lunch"
live true
end
factory :post_category do
name "Jellies"
end
end
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "spree_essential_blog/version"
Gem::Specification.new do |s|
s.name = "spree_essential_blog"
s.version = SpreeEssentialBlog::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Spencer Steffen"]
s.email = ["[email protected]"]
s.homepage = "https://github.com/citrus/spree_essential_blog"
s.summary = %q{Spree Essential Blog is a blog plugin for Spree sites equipped with spree_essentials.}
s.description = %q{Spree Essential Blog is a blog plugin for Spree sites equipped with spree_essentials.}
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_paths = ["lib"]
# Runtime
s.add_dependency('spree_essentials', '>= 0.1.3')
s.add_dependency('acts-as-taggable-on', '>= 2.0.6')
# Development
s.add_development_dependency('shoulda', '>= 2.11.3')
s.add_development_dependency('dummier', '>= 0.2.0')
s.add_development_dependency('factory_girl', '>= 2.0.0.rc3')
s.add_development_dependency('capybara', '>= 1.0.0')
s.add_development_dependency('selenium-webdriver', '>= 0.2.2')
s.add_development_dependency('sqlite3', '>= 1.3.3')
s.add_development_dependency('spork', '>= 0.9.0.rc9')
s.add_development_dependency('spork-testunit', '>= 0.0.5')
end
@thinktainer
Copy link

I downgraded to 2.0.0.rc1 which has fixed it for me

@citrus
Copy link
Author

citrus commented Jul 8, 2011

Downgrading to factory_girl 2.0.0.rc1 works for me as well...

@gravis
Copy link

gravis commented Jul 8, 2011

Thanks, same pb here :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment