Testing controller concerns in Rails

Concerns are a great way to organize and de-duplicate code in Rails.One of my favorite use cases is to abstract everything out of the ApplicationController into concerns. This begs the question: how do you test these concerns?The approach for testing concerns is a bit of a judgement call as they're always mixed in with a class and aren't used on their own. Ideally we'd write tests to verify the behavior of a class which would also test the concern in the bargain.
Testing controller concerns in Rails #ruby #rubydeveloper #rubyonrails #testing https://rubyonrails.ba/single/testing-controller-concerns-in-rails

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles