I'm trying to set up Factory Girl with Test::Unit and Shoulda in Ruby on Rails. I have installed the gem, created my factory file under the test/factories directory, and created my spec file under the test/models directory. The current error I'm getting is 'ArgumentError: No such factory: test', which leads me to believe that the test_factory.rb file is not being loaded? Any idea as to what I should change?
Here are my files.
#test/factories/test_factory.rb
Factory.define :test do |t|
t.name 'test_spotlight'
t.label 'test spotlight label'
end
and
#test/modes/test_spec.rb
require 'test_helper'
require 'factory_girl'
class TestTest < Test::Unit::TestCase
def setup
@test = Factory.build(:test)
end
context "A test" do
should "save with the minimum requirements" do
assert @test.save
end
end
end
test_helper.rb
file. I ran into this while using factory_girl 1.3.3, rails 2.3.11, ruby 1.8.7, and bundler 1.0.10 – Ioannina