Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zeus + FactoryGirl::Syntax::Methods. undefined method `create'

I have:

RSpec.configure do |config|
  config.include FactoryGirl::Syntax::Methods
end

which properly work with simple rspec spec/model/user_spec.rb (allows me to use create(:user), not FactoryGirl.create(:user)). But if I use zeus rspec spec/model/user_spec.rb to speed up my specs, it troughs me an error:

Failure/Error: @user = create(:user)
     NoMethodError:
       undefined method `create' for #<RSpec::Core::ExampleGroup::Nested_2::Nested_1:0x007fc8618e4960>

How I can use this syntax with zeus?

like image 375
freemanoid Avatar asked Mar 13 '13 08:03

freemanoid


2 Answers

Remove either of these lines in spec/spec_helper.rb if they exist:

require 'rspec/autorun'
require 'rspec/autotest'
like image 147
Ilake Chang Avatar answered Nov 16 '22 11:11

Ilake Chang


Did you previously use spork on this project? If so, you have to remove the parts that Spork changed in your spec_helper. Like @ilake-chang said, you have to remove the require 'rspec/autorun' and you'll also want to remove Spork.prefork and Spork.each_run.

See the Zeus wiki on Spork

like image 1
Ruy Diaz Avatar answered Nov 16 '22 10:11

Ruy Diaz