{"id":15404035,"url":"https://github.com/r7kamura/rails_kwargs_testing","last_synced_at":"2025-04-16T20:43:19.414Z","repository":{"id":56890599,"uuid":"130455528","full_name":"r7kamura/rails_kwargs_testing","owner":"r7kamura","description":"Provides Rails 5 compatible testing methods for gradual migration from Rails 4 to 5.","archived":false,"fork":false,"pushed_at":"2020-06-01T10:38:33.000Z","size":22,"stargazers_count":18,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T09:43:11.670Z","etag":null,"topics":["rails"],"latest_commit_sha":null,"homepage":"","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/r7kamura.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":"2018-04-21T08:37:59.000Z","updated_at":"2021-10-05T08:15:42.000Z","dependencies_parsed_at":"2022-08-20T15:20:44.417Z","dependency_job_id":null,"html_url":"https://github.com/r7kamura/rails_kwargs_testing","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r7kamura%2Frails_kwargs_testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r7kamura%2Frails_kwargs_testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r7kamura%2Frails_kwargs_testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r7kamura%2Frails_kwargs_testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r7kamura","download_url":"https://codeload.github.com/r7kamura/rails_kwargs_testing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249275018,"owners_count":21242200,"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":["rails"],"created_at":"2024-10-01T16:11:12.453Z","updated_at":"2025-04-16T20:43:19.396Z","avatar_url":"https://github.com/r7kamura.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RailsKwargsTesting\n\n[![Gem](https://img.shields.io/gem/v/rails_kwargs_testing.svg)](https://rubygems.org/gems/rails_kwargs_testing)\n[![Build Status](https://travis-ci.org/r7kamura/rails_kwargs_testing.png)](https://travis-ci.org/r7kamura/rails_kwargs_testing)\n\nProvides Rails 5 compatible testing methods for gradual migration from Rails 4 to 5.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"rails_kwargs_testing\"\n```\n\nAnd then execute:\n\n```bash\nbundle\n```\n\nOr install it yourself as:\n\n```ruby\ngem install rails_kwargs_testing\n```\n\n## For controller tests\n\nPrepend RailsKwargsTesting::ControllerMethods. Supported options are:\n\n- :flash\n- :format\n- :params\n- :session\n- :xhr\n- :as\n\n### Minitest\n\n```ruby\nclass ArticlesControllerTest \u003c ::ActionController::TestCase\n  prepend ::RailsKwargsTesting::ControllerMethods\n\n  def test_create\n    # `post :create, name: \"Hello, World!\"` in Rails 4\n    post :create, params: { name: \"Hello, World!\" }\n    assert_equal 200, response.status\n  end\nend\n```\n\n### RSpec\n\n```ruby\nRSpec.describe ArticlesController do\n  prepend RailsKwargsTesting::ControllerMethods\n\n  describe \"#create\" do\n    subject do\n      # `post :create, name: \"Hello, World!\"` in Rails 4\n      post :create, params: { name: \"Hello, World!\" }\n    end\n\n    it { is_expected.to eq 200 }\n  end\nend\n```\n\n## For request tests\n\nPrepend RailsKwargsTesting::RequestMethods. Supported options are:\n\n- :env\n- :headers\n- :params\n\n### Minitest\n\n```ruby\nclass CreateArticleTest \u003c ActionDispatch::IntegrationTest\n  prepend ::RailsKwargsTesting::RequestMethods\n\n  def test_create_article\n    # `post \"/articles\", name: \"Hello, World!\"` in Rails 4\n    post \"/articles\", params: { name: \"Hello, World!\" }\n    assert_equal 200, response.status\n  end\nend\n```\n\n### RSpec\n\n```ruby\nRSpec.describe \"POST /articles\" do\n  prepend RailsKwargsTesting::RequestMethods\n\n  subject do\n    # `post \"/articles\", name: \"Hello, World!\"` in Rails 4\n    post \"/articles\", params: { name: \"Hello, World!\" }\n  end\n\n  it { is_expected.to eq 200 }\nend\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/r7kamura/rails_kwargs_testing.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr7kamura%2Frails_kwargs_testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr7kamura%2Frails_kwargs_testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr7kamura%2Frails_kwargs_testing/lists"}