Hello guys,
I'm trying to set Factory Girl up with Cucumber but I have hard time
to do it.
1- I have installed the gem through
gem install thoughtbot-factory_girl --source
http://gems.github.co
[and I can see it (thoughtbot-factory_girl (1.2.1)) listed among my
gems when I run gem list]
2- I have created a file called factories.rb in my spec falder
3- I have added the line below to my cucumber/env file
require "#{Rails.root}/spec/factories"
4- my factories.rb looks like
Factory.define :article do |a|
a.code "9999999"
a.name "foo"
a.unit "bar"
end
When I run cucumber features I get the error below:
uninitialized constant Factory (NameError)
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/
dependencies.rb:443:in `load_missing_constant'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/
dependencies.rb:80:in `const_missing'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/
dependencies.rb:92:in `const_missing'
/SoftwareElement/solution/solutionapp/spec/factories.rb:1
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`polyglot_original_require'
/Library/Ruby/Gems/1.8/gems/polyglot-0.2.5/lib/polyglot.rb:54:in
`require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/
dependencies.rb:158:in `require'
./features/support/env.rb:25
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`polyglot_original_require'
/Library/Ruby/Gems/1.8/gems/polyglot-0.2.5/lib/polyglot.rb:54:in
`require'
/Users/sigfrid/.gem/ruby/1.8/gems/cucumber-0.3.11/bin/../lib/cucumber/
cli/main.rb:95:in `require_files'
/Users/sigfrid/.gem/ruby/1.8/gems/cucumber-0.3.11/bin/../lib/cucumber/
cli/main.rb:104:in `each_lib'
/Users/sigfrid/.gem/ruby/1.8/gems/cucumber-0.3.11/bin/../lib/cucumber/
cli/main.rb:102:in `each'
/Users/sigfrid/.gem/ruby/1.8/gems/cucumber-0.3.11/bin/../lib/cucumber/
cli/main.rb:102:in `each_lib'
/Users/sigfrid/.gem/ruby/1.8/gems/cucumber-0.3.11/bin/../lib/cucumber/
cli/main.rb:95:in `require_files'
/Users/sigfrid/.gem/ruby/1.8/gems/cucumber-0.3.11/bin/../lib/cucumber/
cli/main.rb:47:in `execute!'
/Users/sigfrid/.gem/ruby/1.8/gems/cucumber-0.3.11/bin/../lib/cucumber/
cli/main.rb:25:in `execute'
/Users/sigfrid/.gem/ruby/1.8/gems/cucumber-0.3.11/bin/cucumber:9
/usr/bin/cucumber:19:in `load'
/usr/bin/cucumber:19
Am I missing something?
Thanks and have a nice day.
Sig