Reputation: 796
I cannot run rpsec after merging my code from Github.
I keep getting FactoryGirl error :
uninitialized constant ControllerMacros::FactoryGirl
1) Question has a valid factory
Failure/Error: expect(FactoryGirl.build(:question)).to be_valid
NameError:
uninitialized constant FactoryGirl
# ./spec/models/question_spec.rb:14:in `block (2 levels) in '
Please help.
Upvotes: 0
Views: 289
Reputation: 2732
If this is for a Rails project, you can avoid finding definitions manually by using factory_girl_rails, which will automatically load your definitions for you.
Upvotes: 0
Reputation: 26193
It appears that FactoryGirl may be missing some definitions. Try declaring the following in your spec_helper
:
# spec/spec_helper.rb
require 'factory_girl'
FactoryGirl.find_definitions
Upvotes: 2