RailsApps / rails-stripe-membership-saas

An example Rails 4.2 app with Stripe and the Payola gem for a membership or subscription site.
http://railsapps.github.io/rails-stripe-membership-saas
1.14k stars 232 forks source link

'rake spec' fails with 'Factory not registered: role' #24

Closed DanielKehoe closed 12 years ago

DanielKehoe commented 12 years ago
rake spec
/Users/danielkehoe/.rvm/rubies/ruby-1.9.3-p327/bin/ruby -S rspec ./spec/controllers/content_controller_spec.rb ./spec/controllers/home_controller_spec.rb ./spec/controllers/users_controller_spec.rb ./spec/mailers/user_mailer_spec.rb ./spec/models/user_spec.rb
.......................FF

Failures:

  1) User#update_plan updates a users role
     Failure/Error: @role1 = FactoryGirl.create(:role, name: "silver")
     ArgumentError:
       Factory not registered: role
     # ./spec/models/user_spec.rb:119:in `block (3 levels) in <top (required)>'

  2) User#update_plan wont remove original role from database
     Failure/Error: @role1 = FactoryGirl.create(:role, name: "silver")
     ArgumentError:
       Factory not registered: role
     # ./spec/models/user_spec.rb:119:in `block (3 levels) in <top (required)>'

Finished in 3.66 seconds
25 examples, 2 failures

Failed examples:

rspec ./spec/models/user_spec.rb:124 # User#update_plan updates a users role
rspec ./spec/models/user_spec.rb:130 # User#update_plan wont remove original role from database
tmock12 commented 12 years ago

Also can't seem to replicate the error on this one. Did a force pull of this master branch. tried dropping db, etc. did you change something locally?

DanielKehoe commented 12 years ago

The failure is with a version generated by Rails Composer. Looks like rails_apps_composer fails to create the spec/factories/roles.rb file. I'll follow up with an update to rails_apps_composer.