How To Test A Controller in Ruby On Rails

Written by arslanbisharat | Published 2020/08/17
Tech Story Tags: backend | testing | mvc | mvc-basics | code-quality | software-development | qa | software-testing

TLDR How To Test A Controller in Ruby On Ruby On Rails is part of the first section of this article. We'll discuss a little bit philosophy of testing but more writing tests. The first test I am going to write is a controller test. The job of the index action here is to load the post using the model and then saving it as instance variable and returning some kind of response. The simplest test we can write is to test the response. In this case I have a post controller test which is generated when i generated the controller.via the TL;DR App

no story

Written by arslanbisharat | Full-Stack Software Developer
Published by HackerNoon on 2020/08/17