I've installed rspec through rails g rspec:install
. ANd according to the documentation of rspec that would suffice to create models (model_spec.rb
)
So I created a model right after rails g model group name:string
. It creates a test_unit model but no rspec model. using generate
instead of g
didn't help either.
Here's my test-part of my gemfile:
group :test do
gem 'guard-rspec'
gem 'capybara', '~> 2.0'
gem 'factory_girl_rails', '~> 4.2'
gem 'rspec-rails', '~> 2.14'
gem 'fuubar'
gem 'cucumber-rails', require: false
gem 'guard'
gem 'guard-bundler'
gem 'guard-cucumber'
gem 'rb-inotify', require: false
gem 'rb-fsevent', require: false
gem 'rb-fchange', require: false
gem 'growl'
gem 'shoulda'
gem 'simplecov', require: false
end
Am I forgetting something perhaps?
You need to add the gem to the development group too. According to the rspec-rails GitHub page:
Add
rspec-rails
to both the:development
and:test
groups in the Gemfile:
After that bundle install
and rails generate rspec:install
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments