
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
rspec-routes_coverage
Advanced tools
Rails-RSpec plugin that will track the coverage of routes among your request specs. Intended for massive Rails JSON backends.
Add this line to your application's Gemfile:
gem 'rspec-routes_coverage'
And then execute:
$ bundle
This gem allows tracking both – manual coverage and automatic coverage. Automatic coverage just works – as soon as any route got at least one request it will be considered auto-tested.
To allow manual coverage the gem defines describe_request
helper. Being an extension of describe
, this method requires route to be passed. Every route passed to describe_request
will be considered manually-tested.
spec/requests/items_spec.rb:
require 'spec_helper'
describe ItemsController do
describe_request :index, request_path: '/items', method: 'GET' do
it 'lists items' do
get '/items'
# ...
end
end
# another style:
describe_request 'GET /items/:id' do
it 'shows item' do
get "/items/#{Item.first.id}"
# ...
end
end
end
Default gem output looks the following way:
Routes coverage stats:
Manually tested: 46/547
Auto tested: 34/547
Pending: 467/547
By default it contains no details. To get the complete listing of routes belonging to each category, you can use LIST_ROUTES_COVERAGE=true
environment option:
$ LIST_ROUTES_COVERAGE=true rake spec
Alternatively you can run the following Rake task (ships with the gem):
$ rake spec:requests:coverage
To skip routes you are not going to test you can use the following options:
RSpec.configure do |config|
config.routes_coverage.exclude_namespaces = %w(back)
config.routes_coverage.exclude_routes = [
/GET \//,
/POST \/sessions.*/
]
end
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)It is free software, and may be redistributed under the terms of MIT license.
FAQs
Unknown package
We found that rspec-routes_coverage 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.