rails-controller-testing icon indicating copy to clipboard operation
rails-controller-testing copied to clipboard

Add identifier option to #render_template

Open r7kamura opened this issue 4 years ago • 1 comments

In my Rails app, I needed to write a test that distinguishes whether a template for smartphone (e.g. app/views/articles/index.html+smartphone.erb) or one for PC (e.g. app/views/articles/index.html.erb) was rendered, but I couldn't write such test with the current rails-controller-testing implementation. This is because it only provides virtual_path (e.g. articles/index), which doesn't contain the variants information.

I'd like to add a new option identifier to be able to write these kinds of tests.

r7kamura avatar Nov 29 '21 08:11 r7kamura

I added another pull request to fix CI failures, though the failures have nothing to do with this change.

r7kamura avatar Nov 29 '21 20:11 r7kamura