I try running my RSpec test:
rspec comments.rb
but keep getting the same error (see title). Before anyone asks I have already added require factory_girl
to spec_helper.rb.
The contents of spec/factories/comments.rb
file are:
FactoryGirl.define do
factory :comment do
comment "MyString"
task_id 1
end
end
Here is testing group of the gemfile where I included factory_girl_rails:
source 'http://rubygems.org'
...
group :development, :test do
gem 'debugger'
gem 'factory_girl_rails'
gem 'rspec-rails'
end
...
You just have to add the following in your spec_helper.rb file
require 'factory_girl_rails'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With