{"id":26566223,"url":"https://github.com/yb66/rack-test-accepts","last_synced_at":"2026-04-26T16:31:59.589Z","repository":{"id":7156795,"uuid":"8456051","full_name":"yb66/rack-test-accepts","owner":"yb66","description":"Helpers for rack-test for the HTTP_ACCEPT header.","archived":false,"fork":false,"pushed_at":"2017-12-13T02:35:26.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T14:05:14.064Z","etag":null,"topics":["mime","mime-types","rack","ruby","spec","testing"],"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/yb66.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-27T13:03:13.000Z","updated_at":"2019-06-06T01:24:42.000Z","dependencies_parsed_at":"2022-08-19T16:11:30.459Z","dependency_job_id":null,"html_url":"https://github.com/yb66/rack-test-accepts","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yb66%2Frack-test-accepts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yb66%2Frack-test-accepts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yb66%2Frack-test-accepts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yb66%2Frack-test-accepts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yb66","download_url":"https://codeload.github.com/yb66/rack-test-accepts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244966503,"owners_count":20539795,"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":["mime","mime-types","rack","ruby","spec","testing"],"created_at":"2025-03-22T18:19:28.800Z","updated_at":"2026-04-26T16:31:59.535Z","avatar_url":"https://github.com/yb66.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rack::Test::Accepts\n\nHelpers for rack-test that mean I don't need to remember the accept header syntax, or whether to prepend HTTP to them.\n\n### Build status ###\n\nMaster branch:\n[![Build Status](https://travis-ci.org/yb66/rack-test-accepts.png?branch=master)](https://travis-ci.org/yb66/rack-test-accepts)\n\n## Why? ##\n\nJust to make life a bit easier.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'rack-test-accepts'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install rack-test-accepts\n\n## Usage\n\nIt's easy to add this in where it's needed by including it via the RSpec config:\n\n    require 'rack/test/accepts'\n\n    RSpec.configure do |config|\n      config.include Rack::Test::Accepts, :type =\u003e :request\n\nthen:\n\n    describe \"My route\", :type =\u003e :request do\n      let(:body) { { :key =\u003e \"abcdef\" }.to_json }\n      before do\n        post '/channel/create', body, env(:accepts_json)\n      end\n\nIt will work for any of the mime types listed in [Rack::Mime::MIME_TYPES](https://github.com/rack/rack/blob/master/lib/rack/mime.rb#L54) e.g.\n\n    get \"/\", {}, env(:accepts_zip)\n    put \"/\", {}, env(:accepts_xml)\n    delete \"/\", {}, env(:accepts_asm)\n\nor whichever crazy format your routes want to accept.\n\n### XHR ###\n\nIt also detects XHR in either of two ways.\n\n    get \"/\", {}, env(:accepts_xhr)\n    get \"/\", {}, env(:via_xhr)\n\nThere's no difference.\n\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyb66%2Frack-test-accepts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyb66%2Frack-test-accepts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyb66%2Frack-test-accepts/lists"}