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 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?
Thanks
Never mind, I sorted it out by merging both factories into the same file instead of separate files for active and inactive sales.