
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
= RSpec HTTP 0.11.0
(c) Copyright 2010-2011 {C42 Engineering}[http://c42.in]. All Rights Reserved.
RSpec HTTP is a RSpec extension library that adds support for writing specs that cover HTTP based APIs (or more popularly, RESTful APIs).
To use this library, first add the rspec-http gem to your Gemfile like so: gem 'rspec-http'
Then add the following line to your spec_helper.rb: require 'rspec/http'
This will make matchers such as the ones listed below available to you in your specs.
expect(response).to be_http_ok
expect(response).to be_http_created
expect(response).to be_http_unprocessable_entity
expect(response).to be_http_im_a_teapot
expect(response).to have_header('Content-Type')
expect(response).to have_header('Content-Type' => 'application/json')
expect(response).to have_header('Content-Type' => /json/)
== Rails
If you're using Rails (and implicitly, rspec-rails), the same http code matchers will also be available in your controller specs without the http
namespace.
In other words, in your controller specs you can do:
expect(response).to be_ok
expect(response).to be_created
expect(response).to be_unprocessable_entity
expect(response).to be_im_a_teapot
FAQs
Unknown package
We found that rspec-http demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.