{"id":19339378,"url":"https://github.com/appfolio/rails-forward_compatible_controller_tests","last_synced_at":"2025-06-14T14:33:24.385Z","repository":{"id":22397058,"uuid":"96134177","full_name":"appfolio/rails-forward_compatible_controller_tests","owner":"appfolio","description":"Back-porting Rails 5 controller \u0026 integration tests into Rails 4","archived":false,"fork":false,"pushed_at":"2022-02-04T23:42:13.000Z","size":88,"stargazers_count":19,"open_issues_count":2,"forks_count":5,"subscribers_count":33,"default_branch":"master","last_synced_at":"2025-05-18T02:46:57.010Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appfolio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-03T17:17:32.000Z","updated_at":"2023-12-07T22:16:33.000Z","dependencies_parsed_at":"2022-07-25T13:17:16.415Z","dependency_job_id":null,"html_url":"https://github.com/appfolio/rails-forward_compatible_controller_tests","commit_stats":null,"previous_names":["appfolio/controller-testing-kwargs"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/appfolio/rails-forward_compatible_controller_tests","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfolio%2Frails-forward_compatible_controller_tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfolio%2Frails-forward_compatible_controller_tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfolio%2Frails-forward_compatible_controller_tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfolio%2Frails-forward_compatible_controller_tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appfolio","download_url":"https://codeload.github.com/appfolio/rails-forward_compatible_controller_tests/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfolio%2Frails-forward_compatible_controller_tests/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259831059,"owners_count":22918445,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T03:21:51.048Z","updated_at":"2025-06-14T14:33:24.295Z","avatar_url":"https://github.com/appfolio.png","language":"Ruby","readme":"# Rails::ForwardCompatibleControllerTests\n\nBackport Rails 5 style controller/integration testing syntax using kwargs to Rails 4.  Supports minitest and rspec.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'rails-forward_compatible_controller_tests', require: false\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install rails-forward_compatible_controller_tests\n\nAt the appropriate spot in your `test_helper.rb`, `spec_helper.rb`, or similar file add the following line:\n\n```ruby\nrequire 'rails/forward_compatible_controller_tests'\n```\n\nIf using rspec, add the following lines to your rspec config:\n\n```ruby\nconfig.include Rails::ForwardCompatibleControllerTests, type: :controller\nconfig.include Rails::ForwardCompatibleControllerTests, type: :request\n```\n\n## Usage\n\nAllows you to simultaneously use the old and new syntax while making HTTP calls to your controllers\nin your test suite. So both:\n\n```ruby\nget #{url_or_action}, params, headers\nxhr :post, #{url_or_action}, params, headers\n```\n\nand\n\n```ruby\nget #{url_or_action}, params: params, headers: headers\nget #{url_or_action}, xhr: true, params: params, headers: headers\n```\n\nshould work while you transition your test suite.\n\n## Modes of Operation\n\nDeprecation warnings will appear by default when executing statements that\nutilize the old method. Deprecation warnings can be disabled by adding the\nfollowing to your appropriate test helper:\n\n```ruby\nRails::ForwardCompatibleControllerTests.ignore\n```\n\nThe above is useful if you simply want to support the Rails 5 syntax. If\ninstead you want to prevent new uses of the old syntax, add the following:\n\n```ruby\nRails::ForwardCompatibleControllerTests.raise_exception\n```\n\nThe above is useful when you're done coverting the syntax but are not yet ready\nto make the switch to Rails 5.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies.\n\nThis library uses [Appraisal](https://github.com/thoughtbot/appraisal) to run specs in Rails 4 and 5:\n- `bundle exec appraisal actionpack-4.2 rake`.\n- `bundle exec appraisal actionpack-5.0 rake`.\n\nThe library is a no-op when used with Rails 5 (it doesn't affect the implementation of controller tests). You can run the tests in Rails 5 mode to ensure that the behaviour native to Rails 5 is the same as the behaviour in Rails 4 with the library.\n\nYou can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/appfolio/rails-forward_compatible_controller_tests.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappfolio%2Frails-forward_compatible_controller_tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappfolio%2Frails-forward_compatible_controller_tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappfolio%2Frails-forward_compatible_controller_tests/lists"}