Can not determine issue in my factories with factory girl in rspec

Hi Folks,

I hope you’re doing good. Sorry for a long email. I am just trying my best to learn something new and, need your help to understand/ sort a small issue which I am not able to figure out.

I have create couple of factories and created some examples for rspec for one of my projects. I have got everything working on my local. Even, my specs are green on local for both ruby version: 1.9.2 and 1.9.3. I just don’t understand why travis-ci is failing to build the same commit.

Here is the link to travis-ci’s builds:

Job #1(Build 64): https://travis-ci.org/suryart/spree_active_sale/builds/5850619

Job #2(Build 65): https://travis-ci.org/suryart/spree_active_sale/builds/5850754

Reason why I find this weird is because, build 64 is failing to run specs against ruby version of 1.9.2, and passing for 1.9.3. However build 65 is failing to run specs against ruby version of 1.9.3, and passing for 1.9.2. And there is no change in code at all for both the builds.

However, for both builds which are failing throw the same error:

/home/travis/.rvm/gems/ruby-1.9.2-p320/gems/factory_girl-4.2.0/lib/factory_girl/registry.rb:24:in `find': Factory not registered: active_sale (ArgumentError)
from /home/travis/.rvm/gems/ruby-1.9.2-p320/gems/factory_girl-4.2.0/lib/factory_girl/decorator.rb:10:in `method_missing'

Since, the code is very long. I’ll reference it from the commit on github.

spec/factories/active_sale_factories.rb:https://github.com/suryart/spree_active_sale/blob/43cb160d0e4ea1ad694af3f1d848c22a3193cc2a/spec/factories/active_sale_factories.rb

spec/factories/inactive_sale_factories.rb:https://github.com/suryart/spree_active_sale/blob/43cb160d0e4ea1ad694af3f1d848c22a3193cc2a/spec/factories/inactive_sale_factories.rb

What I know, the issue is coming from this line in active_sale_factories.rb at line 5:

factory :active_sale, :class => Spree::ActiveSale do |f|
  name "Dummy Sale"
end

Which can not be determined from inactive_sale_factories.rb defined factories, I suppose. But, why is that happening? Why is it working for different versions for different builds when there is absolutely no code change?

I am new to rspec and factories and doing all this for first time. It will be very grateful if you can explain this behavior or point out what I am doing wrong here? Or maybe can help me here to solve this issue?

Just in case if you would prefer/like to answer on Stackoverflow: http://stackoverflow.com/questions/15674838/can-not-determine-issue-in-my-factories-with-factory-girl-in-rspec

Thanks