What is a suitable testing framework for Rails 3?

点点圈 提交于 2019-12-06 10:40:48

The first tip is: Try upgrading to Rails 5.x. This is good practice to always leave your system clean and faultless from third parties.

Your greatest friend will always be the rails documentation: http://guides.rubyonrails.org/v3.2/testing.html

In last case if you can not upgrade, you can use the Minitest/Rspec gems, in old versions compatible with the current versions of development.

To perform integration testing you can try using Capybara or Google Chrome Headless.

You can look at how some big projects do tests, like the RubyGems site, which is written in RoR and is open in Github: https://github.com/rubygems/rubygems.org

I am using Rspec from last two years and from my point of view it is easiest testing framework for Ruby that I have used.

In Rspec, you have to create objects of your models using factories and use it in script.

There are only 3 - blocks to write in Rspec : describe, context and it.

Refer - https://relishapp.com/rspec/rspec-rails/v/3-0/docs/model-specs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!