In rails 3.2.8 engine, when a model is created with "rails generator model my_model", there is no models/my_model_spec.rb was generated under spec directory. The rspec-rails used is 2.12.0. In engine's gemspec file, there is:
s.add_development_dependency "rspec-rails", ">= 2.0.0"
"rails generator rspec;Install" was executed for rspec installation. Here is the output of the rails generator:
$ rails g model category name:string description:string last_updated_by_id:integer active:boolean
This could be related to #8229, which was fixed with #8262
@emclab can you verify this behavior agains rails 3-2-stable ?
We are using rails 3.2.8 and how do I verify this behavior against rails 3-2-stable? I am kind of new to rails issue reporting. Here is the command we use to create rails engine:
rails plugin new my_eng --mountable --dummy-path=spec/dummy
Do we need to add option --full to command above?
"rails plugin new my_eng --mountable --dummy-path=spec/dummy --full" did not change anything on rails 3.2.8 engine. There still is no spec file/directory created under spec.
I verified against 3-2-master and the problem persists. I'll investigate and report when I found the cause.
Here is a workaround. The following code in rails engine's lib/../engine.rb will enable rspec and factory girl with rails generator:
config.generators do |g|
g.fixture_replacement :factory_girl, :dir => "spec/factories"
If not using factory girl, the last line (about factory girl) could be removed. The code works in rails 3.2.9.
Hey @senny did you got anything here ? Or this can be closed if already fixed :-)
This issue has been automatically marked as stale because it has not been commented on for at least
The resources of the Rails team are limited, and so we are asking for your help.
If you can still reproduce this error on the 4-1-stable, 4-0-stable branches or on master,
please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions.
This issue has been automatically closed because of inactivity.