Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Comprehensive guide on testing rails app

Is there any comprehensive guides on testing rails apps. Im searching for guide that will tell me what should I test and how should I test it especially with Rspec. Lots of examples will be appreciated.

like image 471
Andrey Kryachkov Avatar asked Jan 21 '12 21:01

Andrey Kryachkov


People also ask

How do I test a Rails application?

We can run all of our tests at once by using the bin/rails test command. Or we can run a single test file by passing the bin/rails test command the filename containing the test cases. This will run all test methods from the test case.

What are test Rails?

TestRail is a web-based test management tool used by testers, developers and other stake holders to manage, track and organize software testing efforts. It follows a centralized test management concept that helps in easy communication and enables rapid development of task across QA team and other stakeholders .

What is integration testing in Rails?

While unit tests make sure that individual parts of your application work, integration tests are used to test that different parts of your application work together.


3 Answers

The RSpec Book

Testing the rails app is part of development so I'd sugest to read Ruby on Rails Tutorial, Learn Rails by Example by Michael Hartl, it has good explained testing process.

like image 118
megas Avatar answered Sep 28 '22 14:09

megas


The Rails Guide A Guide to Testing Rails Applications is a good place to start.

It covers the default test/unit style of testing.

As suggested by @megas, the RSpec book is another place to look.

Agile Web Development with Rails is a great first book for any rails developer, covering the full process of building an application, testing it as you go.

like image 35
Matthew Rudy Avatar answered Sep 28 '22 13:09

Matthew Rudy


Also take a look at Railscast as well.

Some episodes that talks about testing:

Episode 275: How I Test

Episode 257: Request Specs and Capybara

Episode 158: Factories not Fixtures revised or Older Episode

Episode 261: Testing JavaScript with Jasmine

like image 32
Jhony Fung Avatar answered Sep 28 '22 14:09

Jhony Fung