rails-controller-testing
rails-controller-testing copied to clipboard
Brings back `assigns` and `assert_template` to your Rails tests
This is naive attempt to fix the test suite for Rails 6.1. Fixes #64
* Brings back `!render_template.action_view` instrumentation when rendering with ActionView::Template::RawFile See https://github.com/rails/rails-controller-testing/pull/46 for discussion. Note that all I did was rebase the work of @tconst onto the newest commit of [rails-controller-testing](https://github.com/rails/rails-controller-testing).
### Context [travis-ci.org](https://www.travis-ci.org/) is dead and the current CI pipeline is not working. ### Change To ensure compatibility with Ruby and Rails, I propose using GitHub Actions for CI. The...
I would expect ```ruby render( partial: 'path/to/partial', locals: { arg1: 'value-for-arg1', arg2: 'value-for-arg2', arg3: 'value-for-arg3', }, ) expect(view).to render_template( partial: 'path/to/partial', locals: { arg1: 'value-for-arg1', arg2: 'value-for-arg2', arg3: anything, },...
I have a bit of code that is render-ing a template like so: `render file: Rails.root.join('public', 'webpack_assets', 'index.html'), layout: false` This was previously being tested (with Rails 5) with an...
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...
When calling `get :action, params: { params: 'string' }`, RouteSet#url_for is trying to merge! the inner params string into the params hash. https://github.com/rails/rails/blob/main/actionpack/lib/action_dispatch/routing/route_set.rb#L826 I added a failing test here: https://github.com/sholden/rails-controller-testing/blob/bug/merge-nested-params/test/controllers/template_assertions_test.rb#L190...
[Testing against Rails 6.0](https://travis-ci.org/github/rails/rails-controller-testing/jobs/705868237), there are fired depracation warnings: ~~~ .DEPRECATION WARNING: render file: should be given the absolute path to a file (called from render_file_relative_path at /home/travis/build/rails/rails-controller-testing/test/dummy/app/controllers/template_assertions_controller.rb:23) DEPRECATION WARNING:...
I am trying to run the controller test in the Rails application. ## Controller code Here is the code I'm trying to test (`/app/controllers/projects_controller.rb`): ``` class ProjectsController < ApplicationController ##...