Why Write Rails View Tests

Nikola Đuza
Level Up Coding
Published in
5 min readMar 30, 2021

--

Photo by Nuno Silva on Unsplash

There are many ways to test a Ruby on Rails application, but there is one way that is not so often discussed. That is the way of testing Rails views. Yes — there are controller, model, and other types of tests, but we rarely see the view layer tests. Let’s give them more attention and see what they are all about.

You might ask — well, why don’t you write integration tests and test view layer with them? I could, but…

--

--

Nikola helps developers improve their productivity by sharing pragmatic advice & applicable knowledge on JavaScript and Ruby. https://pragmaticpineapple.com/ 🍍