为什么铁轨不是生成规格而是淘汰的?
我正在使用Rails 7。 我刚刚以这种方式安装了rspec-rails
:
# Gemfile
group :test do
gem "rspec-rails"
end
我生成了一个控制器。
$ rails g controller welcome home
create app/controllers/welcome_controller.rb
route get 'welcome/home'
invoke erb
create app/views/welcome
create app/views/welcome/home.html.erb
invoke test_unit
create test/controllers/welcome_controller_test.rb
invoke helper
create app/helpers/welcome_helper.rb
invoke test_unit
但是我发现铁轨生成了最大的,而不是规格。
为什么这是?我该怎么办来解决这个问题?
I'm using rails 7.
I've just installed rspec-rails
in this way:
# Gemfile
group :test do
gem "rspec-rails"
end
And I generated a controller.
$ rails g controller welcome home
create app/controllers/welcome_controller.rb
route get 'welcome/home'
invoke erb
create app/views/welcome
create app/views/welcome/home.html.erb
invoke test_unit
create test/controllers/welcome_controller_test.rb
invoke helper
create app/helpers/welcome_helper.rb
invoke test_unit
But I found out that rails generated minitests instead of specs.
Why is this? What should I do to fix this out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有必要将
RSPEC-RAILS
添加到:开发
组以使生成器正常工作。我发现了在这里
It is necessary to add
rspec-rails
to:development
group in order to get generators working.I found this out here